Linked Questions

18
votes
4answers
81k views

How to delete all the files with a certain extension from a folder and all of its subfolders? [duplicate]

I want to remove all the .jpg files from my Music folder in order to save room. My Music folder contains subfolders, and I would like to know if there is a command to remove all the .jpg files from ...
0
votes
3answers
2k views

recursively delete subdirectories and files [duplicate]

I have the following files and directories configuration: -Parent_dir |-delme_dir |-delme_file |-aFile |-sub_dir |-delme_dir |-delme_file |-aFile |-...
1
vote
1answer
4k views

Delete all hidden files recursively in current directory [duplicate]

I have a directory which contains hidden files and by that I mean, not just the files whose name starts with . but also the files whose name contains ~ character at the end like somefile.txt~. I want ...
2
votes
1answer
2k views

What command should I use to rm all .png files in a folder and subfolder? [duplicate]

I started with this based off of another question I had: find -type f -iname '*.png' -exec rm that clearly didn't work, but am I atleast warm?
1
vote
1answer
1k views

How to delete all .class and .csv.gz files in the folder and all the subdirectories in SVN [duplicate]

I'm trying to delete all .class and .csv.gz files from my svn directory and all subdirectories. Can anyone tell me how to do it automatically with a command ? I have RabbitSVN installed on my Ubuntu. ...
1
vote
0answers
25 views

Delete file with a likely name [duplicate]

I have a folder which contain .srt and .txt files inside /var/www/myvideo folder with filename like this: /var/www/myvideo/course1/module1/dasa22.en.srt /var/www/myvideo/course1/module1/dasa22.en....
6
votes
2answers
7k views

How to copy an entire directory except one file in each sub-directory via terminal? [duplicate]

I have a folder named 'Java' which has 20 sub folders ('Day-01' to 'Day-20'). Each sub folder has one or two '.wav' files along with few other files. I want to copy the entire directory except the '....
2
votes
4answers
15k views

How to delete files with the same extension in one go using rm?

I had compiled many C programs together, and each of the file had a .gch created. Now I did not want the .gch files so I decided to delete them. But it would take lots of time using rm for deleting ...
1
vote
1answer
2k views

delete all files in a directory with multiple extensions

I have files that fall into two extension categories (.out and .error). Is there a single command that can delete them all at once? I tried rm -f *.out || *.error but it did not work. Thanks (i ...
1
vote
1answer
212 views

How to delete all files of a specefic name from /?

I want to delete all files named typhoon.svg from / partition. How to do that via command line?