Delete garbage files, directories under linux

Since coding reasons, on the linux server upload, create a file or directory Chinese, will be garbled, if you want to remove it, find a rm command is not deleted

In this case, you can delete files or directories with garbled find command.

First, go to the directory where the file or directory garbled

Use ls -i command to find the file or directory inode,

File or directory in front of the string of numbers is the inode,

Next, use the find command to query and delete the file or directory

find -inum 2623190 -delete

Note: This method applies only to delete a file or an empty folder.

Non-empty folder how to delete it?

First and first check inode,

Then use the following command:

find -inum 2236429 -exec rm -rf {} \;

 This will prompt can not find the file or folder, but has in fact removed.

 

Guess you like

Origin www.cnblogs.com/xzlive/p/10942376.html