Linux Delete special character files

Source: Internet
Author: User

1. How to delete the file name with "-"

Use--(2 bars)

#touch---%f-%t

#rm---%f-%t

Rm:remove regular empty file '-%f-%t '?

Use absolute Path and tab special file name

#rm/root/-%f-%t

Rm:remove regular empty file '/root/-%f-%t '?

2. Delete files that contain other special characters

For file names that contain other special characters, such as <>!*,

Available

"Escape character \ or" "double quotation mark

#touch ">123file"

#rm ">123file"

Rm:remove regular empty file ' >123file '?

#touch '!rul4 '

#rm \!rul4 If you use the TAB key here, the system will automatically help you adjust the syntax for correct deletion.

Rm:remove regular empty file '!rul4 '?

3. Delete the garbled file name that the system cannot make

First Use ls-i to find the inode of the file, and then use the Find command to delete

# LS-ILRT

100985-rw-r--r--1 TBCs users 0 APR 11:32-mxv9.log

100985 of the first column is the inode of the file, and the file can be deleted by executing the following command on the host

Find./-inum 100985-exec rm {} \;


This article is from the "Golden Mystery" blog, please be sure to keep this source http://191226139.blog.51cto.com/211244/1981392

Linux Delete special character files

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.