How to delete files and special files named-A and \a in Linux

Source: Internet
Author: User
Keywords Delete Linux special files
Tags delete delete file delete files directory file files find how to

How do I remove files and special files named-A and \a in Linux?

A delete file named-A

1 rm./-a
2 RM---a,--tells RM this is an option, specifically see getopt
3 ls-i list Inum, then use Find. -inum inum_of_thisfile-exec rm ' {} ' \;

b Delete file named \a

RM \\a

C Delete the name with/and ' the '

These characters are characters that are not allowed by the normal file system, but may be generated in file names, such as NFS file systems under UNIX for use on Mac systems

1 The NFS file system is hung to the no filter '/' character system, delete files containing special file names;

2 Remove the directory of the wrong file name, Ls-id display the Inum,umount file system containing the file directory.

CLRI clears the inum,fsck,mount of the directory, checks the Lost+found directory, and renames the file.

In addition, you can delete files of any file name through Windows FTP

d Delete a file with a name with an invisible character

List file names and dump to files: ls > del.sh

Then edit the contents of the file to add the RM command so that its contents become the format for deleting the above files:

VI del.sh
RM-RF *******

Perform SH del.sh

E http://www.aliyun.com/zixun/aggregation/18137.html "> delete file size zero

1 Rm-i ' find./-size 0 '
2 Find./-size 0-exec rm {} \;
3 find./-size 0 | Xargs Rm-f &
4 for file in * #自己定义需要删除的文件类型
Do
If [!-S ${file}]
Then
RM ${file}
Echo RM $file success!
Fi
Done

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.