How To Delete A File With A Dash?

Asked By 60 points N/A Posted on -
qa-featured

I am having a hard time finding a file with a dash that I know is in the directory but it is not showing up. All I can find in the help files is they are hidden in Linux.  How are you suppose to delete a file that has become hidden?

SHARE
Answered By 0 points N/A #193226

How To Delete A File With A Dash?

qa-featured
Hi James,
 
To remove the non-hidden or hidden files, the following commands can be used.
 
rm -rf /some/path/* deletes all the visible files in that directories (and subdirs).
 
rm -rf /some/path/.* deletes all hidden files in that particular directory . This does not delete the subdirectories and gives a warning.
rm: cannot remove directory: `/some/dir/.'
rm: cannot remove directory: `/some/dir/..'
 
Regards,
Anyet

Login/Register to Answer

Related Questions