Solution 1
To remove a file with dashes, slashes or other special characters, the easiest way is to access the file using its inode. To get the inode of a file, just do a ls -li. When you have that number, use find to delete the file using the following command:
find . -inum [inode] -exec rm -i {} \;
Solution 2
To remove a file whose name starts with a `-', for example `-foo', use one of these commands:
rm --- -foo
rm ./-foo
so,
$ rm --- -\,my\?\ funky.file\$name
Via Johnny chadda
Incoming search terms:
- remove files with special characters
- how to remove file with special characters in linux
- linux how to delete file with special characters
- linux delete file with special characters
- linux remove file with special characters
- linux how to remove files with special characters
- how to remove special characters in linux file
- linux delete file special characters
- linux rm file with special characters
- linux rm file special characters





I use emacs dired to work files that have unprintable characters in their names.
[Reply]
I was always wondering how to do it from the command prompt… The “easy” way was to use mc (midnight commander) to do it. Thank for the nice trick.
[Reply]