Due to encoding reasons, garbled characters will be generated when uploading or creating Chinese files or directories on a Linux server. If you want to delete it, you cannot delete it with the rm command. In this case, you can use the find command to delete the garbled files or directories. In the Linux file system, each file has an i-node number, and the files can be managed by the i-node number. First enter the directory where the garbled file or directory is located Use the ls -i command to find the inode of a file or directory. The numeric string in front of the file or directory is the inode. Next, use the find command to query and delete this file or directory. Note: This method only works for deleting files or empty folders. How to delete a non-empty folder? First, check the inode, and then use the following command: find -inum 2236429 -exec rm -rf {} \; It will prompt that the file or folder cannot be found, but it has actually been deleted. How to delete files with garbled or special characters in the file name under Linux. I encountered a problem today. A file name is
I started thinking about deleting with quotes, but found that deleting with quotes also reported an I found some information and found that this kind of file can be deleted like this First ls -i to find the file's inode, then delete it with the find command [localhost]ls -ilrt 100985 -rw-r--r-- 1 tbcs users 0 Apr 18 11:32 -MXV9.log The 100985 in the first column is the inode of the file. Execute the following command on the host to delete the file [localhost]find ./ -inum 100985 -exec rm {} \; This method is suitable for deleting files with garbled or special characters. For example, if the file name is "*.txt" and you directly execute rm *.txt, all files ending with .txt in the folder will be deleted. Summarize The above is the full content of this article. I hope that the content of this article will have certain reference learning value for your study or work. Thank you for your support of 123WORDPRESS.COM. If you want to learn more about this, please check out the following links You may also be interested in:
|
<<: Navicat for MySQL scheduled database backup and data recovery details
>>: Videojs+swiper realizes Taobao product details carousel
This article example shares the specific code for...
Table of contents 01 Problem Description 02 Solut...
Install the nvidia graphics card driver under Ubu...
After installing MySQL, you will find that the ro...
Mouse effects require the use of setTimeout to ge...
Overview I believe we often encounter such scenar...
1. Merge the margins of sibling elements The effe...
Overview In actual business scenario applications...
1. Update the entire table. If the value of a col...
Copy the following code to the code area of Drea...
Table of contents Preface Axios installation and ...
This article shares the specific code for JavaScr...
Build the project Execute the command line in the...
Tips for using Docker 1. Clean up all stopped doc...
Table of contents Index Model B+Tree Index select...