Linux delete the file filename special symbols

File name length under Linux system to a maximum of 256 characters. Typically, the file name characters include: letter, number, (point), "_" (underscore) and "-" (hyphen). "."
Linux allows the use of other symbols other than the above symbols in the file name, but does not recommend that you do so. Some turn ideographic characters (that is, the character is borrowing system, represents some special meaning) has a special meaning in the Linux command interpreter (shell) in. Such a turn and characters are: "?" (Question mark), "*" (asterisk), "" (space), "$" (currency symbol), "&", expanding number and so on. In the file name should try to avoid using these characters. File names that include "" (space), but the user is encouraged "to replace _" (underscore). "/" Representative of the root directory tree can also be (at similar DOS "\"), thus "/" does not appear in the file name in the path name as delimiters. And, like DOS, "." And ".." are used to represent "the current directory" and "parent directory", so they can not be used as the file name.


1. The file name contains special characters, may not be used directly rm deleted, can use the following methods:
1) using ls -i investigated inode number of the file, it is assumed 654321
2) using the find command to delete 
./ -inum 654321 -exec find rm '{}' \;


2. If the file name is - begin with a hyphen, you can use the following method to delete, such as deleting "-filename" File:
RM - -filename  
RM ./-filename 

Guess you like

Origin www.cnblogs.com/kiko-sunrise/p/11081721.html