4
votes
3answers
1k views

Delete files and directories by their names. No such file or directory

I need to delete all compiled data: directories called build, directories called obj, *.so files. I wrote a command find \( -name build -o -name obj -o -name *.so \) -exec rm -rf {} \; that ...
0
votes
1answer
409 views

Delete all 'nohup.out' within a directory recursively

How can I delete all 'nohup.out' files within a directory recursively from my terminal? I'm using CentOS.
1
vote
1answer
516 views

Does rm -rf * delete files recursively from the current directory or parent/root directory?

I wanted to delete files and folder recursively from a particular folder so I ran this command from that folder rm -rf * I assumed it would delete all files/directories under the current directory ...
1
vote
2answers
531 views

Removing specific files recursively using rm or something simple?

I have a root folder with a text file in it called pairs.txt. Within that root folder are other folders with text files called pairs.txt in them. Is there a simple way to remove them using rm? I ...
8
votes
2answers
7k views

Locate and delete all temporary files in user directory

I use vim a lot, and my area has power failure a lot. So the resultant is I get many *.swp files scattered over my PC. I want an alias of rm command that removes all files with either .swp, ~, ...
9
votes
4answers
13k views

How do I recursively delete directories with wildcard?

I am working through SSH on a WD My Book World Edition. Basically I would like to start at a particular directory level, and recursively remove all sub-directories matching .Apple* - how would I go ...
8
votes
6answers
23k views

How to remove all the files in a directory?

I am trying to remove all files and subdirectories in a directory. I used rm -r to remove all files, but I want to remove all files and subdirectories, excluding the top directory itself. For ...