How to easy remove file with strange file name?
Sometimes, you have a file with strange file name and you want to remove, e.g. -test.txt,
# rm -f -test.txt rm: invalid option -- 't' Try `rm ./-test.txt' to remove the file `-test.txt'. Try `rm --help' for more information.
Another easy way is delete by inode.
# ls -il * 983076 -rw-r--r-- 1 john users 0 Jun 4 21:24 -test.txt
And finally delete it
# find -inum 983076 | xargs rm -f