Deleting directories and files starting with special characters on linux server. Suppose you find directories and files starting with special characters for example —- ##– ##### ## #-#- . Removing it using command rm -rf will give you following output.
[root@Linux ~]# rm -rf ----
rm: unrecognized option `----'
Try `rm ./----' to remove the file `----'.
Try `rm --help' for more information.
Or trying to remove directory with name #-#- will not produce any output (means it will not give any error) but also it will not get delete. ls -l will list directory #-#-
[root@Linux ~]# rm -rf #-#-
[root@Linux ~]# ls -l
total 8
drwxr-xr-x 2 root root 4096 Nov 20 18:25 #-#-
To remove all these directories or files starting special characters just add ./ before name.
[root@Linux ~]# rm -rf ./#-#-
[root@Linux ~]# rm -rf ./----
And you have deleted files & directories starting with special character.













