How to delete multiple hidden files
Hope this isn't a stupid question but I did a search and couldn't find the answer. I am using ubuntu 8.04 and have a separate home partition. While setting it up I had a few failures and was left with several directories containing many hidden files which I can't seem to delete. The man pages for 'rm' didn't seem to provide the answer either.
Is there a flag or escape sequence that will allow 'rm' to delete these files? Dan |
deleting
Hi.
Not sure if it works in Ubuntu but in CentOS I've used rm -rf to delete files and directories without warnings. |
WARNING: using "rm -rf" could be like killing ants with a pile driver.....
First, can you see the files you want to delete? "ls -a" should show all hidden files. Second, check permissions. Or just su to root (or use sudo in Ubuntu and its progeny) If all is in order and you still cannot delete something, then "rm -rf directoryname" can do the trick. First, be absolutely sure that you know what is in that directory. Before doing any of this, having all you data backed up is always a nice touch........:) |
Hey, thanks for the help. I managed to delete the directories using 'rm -rf directory_name'.
I had tried 'rm -rf *" from within the directory but had no luck. I am still not sure why I couldn't delete them them that way but, at least they are gone now. |
Warning !!!
pixellany your absolutely right, it's risky and should not be done unless you're sure what you're doing. My mistake was to take for granted that the user knew what he was doing and therefore I provided this suggestion. What I should have done was to warn him first and then provide the solution. Thank you for the comment, I'll be more careful in the future.
|
rm -rf * does not delete your hidden direcotories. why dont you try with "rm -rf .*"? After executing this, it may give the the error rm: cannot remove `.' or `..'
|
(Solved) How to delete multiple hidden files
kingston said:
"why dont you try with "rm -rf .*"?" I did try that but it did not work. Like I said, I am not sure why. Also, this is my first post to this forum and it wasn't obvious to me how to mark this thread as solved. Hopefully, putting it in the title block will work. |
Quote:
|
Quote:
|
All times are GMT -5. The time now is 06:37 PM. |