![]() |
how to do yes to all when deleting a dir recursively
hi. i want to rm a directory but don't waht to have to click y enter when it prompts me about all the files inside. What option would add to rm to make it say yes to all?
|
Try rm -rf <directory name here>
|
thanks, that was my idea but i wasn't sure.
|
the -i flag is also set to do this, it's in your .profile or /etc/profile I believe, but can't remember. This normally only happens as root though, and I'd leave it so you don't go destroying something you don't want to.
|
while on the subject of removing. I have a tar file i want to remove. When i go to rm it i can hit tab to complete the name. I can see it when i do ls but when i try to rm it it says no file or dir exist
|
There may be spaces at the end of the filename or something. Shell globbing can work nicely here, e.g. if the file starts with foobar, you can do rm -i foobar * (the -i is so you don't accidentally delete something else starting with foobar).
|
You can temporarily get rid of the questions if you have an aliased rm. Type alias to see if this is so. The do
unalias rm to restore the original bash rm command. Next time you login rm will ask for confirmation again. |
All times are GMT -5. The time now is 10:39 PM. |