How Linux servers remove garbled files and folders

Source: Internet
Author: User

How Linux servers remove garbled files and folders home page into the folder where garbled filesBecause of the general trend of PHP, there are more and more opportunities to access Linux servers. Unlike Windows servers, Linux servers only support characters such as numbers, English, etc., and do not recognize the Chinese character. So that caused us to pack the uploaded files after extracting the Chinese garbled files and folders. There are many solutions on the Internet, but today's pro-test with the Find command to quickly delete garbled files and folders, so share with you.

To find the node number of a file or folder using the Ls-i command

The front is the node number, then use the Find command to query and delete

-inum refers to the query according to the node number;-delete is the delete operation as the name implies. This will successfully delete garbled files, it is worth noting that this method only applies to delete files or empty folders. (not verified)

Or use the-exec parameter of find to execute the RM command

Find. -inum 1046808-exec rm {}-RF \;           #这里可以直接使用.    Or is./   

Although we are prompted to find this file or folder, we have already indicated that it was deleted. The-exec function is to execute the command after the lookup, where {} represents the result of the previous query, and the space is +\; it is Terminator, the others do not say. -exec can be followed by any common commands, so this method applies not only to folders, but also to files.

For folders, especially non-empty folders, the above method is not applicable to the use of additional parameters to implement, the first is the same view garbled folder node

[[email protected] src]# ll-i Total usage 208572918624-rw-r--r--1 root root 289 May 16:09 ntpdate.sh1046799 drwxr-xr-x 2 root Root 4096 May 16:07 scripts1046807 drwxr-xr-x 2 root root 4096 May 18:09 test11046792 drwxr-xr-x 2 root root 4096 May 1 3 16:06 webapp[[email protected] src]# find. -inum 1046807-exec rm {}-RF \;find: "./test1": No file or directory [[email protected] src]# find./-inum 1046807-exec rm {}-RF \ ;

This removes the folder and must be used./mode

How Linux servers remove garbled files and folders

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.