Occasionally (hopefully not often), file names on Unix systems get created in various ways with strange characters (e.g. metacharacters) in them. File names containing metacharacters sometimes cause problems when trying to remove them or rename them, being especially problematic when they occur at the start of the file name. Examples of these include, but are certainly not limited to:
-file >file *file #file $file my file # note this file name contains a spaceSome tips or techniques for removing these files are as follows:
rm ">file" rm "my file"
rm \*file rm "\*file"
rm ./-file
ls -li # lists all files inode numbers find . inum-exec rm -i {} \; inode_number
Go Back |
©2015, Mark A. Thomas. All Rights Reserved.