Quantcast
Channel: How can I find and remove big files of a specific type? - Unix & Linux Stack Exchange
Browsing index pages (8 articles)
↧

How can I find and remove big files of a specific type?

I want to clean up large log files and backups from my server:find ./ -size +1M | xargs rmBut I want to exclude mp3 and mp4. I just want to delete log and archive files (zip, tar, etc.)

View Article


Answer by Sundeep for How can I find and remove big files of a specific type?

find -type f \( -name '*.zip' -o -name '*.tar' -o -name '*.gz' \) -size +1M -deletethe \( \) construct allows to group different filename patternsby using the -delete option, you can avoid piping and...

View Article


Answer by techraf for How can I find and remove big files of a specific type?

If you want to exclude files by name, you can use this syntax:find . -type f ! -name '*.mp3' ! -name '*.mp4' -size +1M -deleteor if your find does not support delete:find . -type f ! -name '*.mp3' !...

View Article

Answer by Matthew Hub for How can I find and remove big files of a specific...

Based on the above answers I used below command to clear the server from big log files (after cd'ing into /var/lib/jenkins)find -type f -name *log -size +500M -delete

View Article

find and remove files bigger than a specific size and type

I want to clean up my server from large log files and backups.I came up with this:find ./ -size +1M | xargs rmBut I do not want to include mp3 and mp4. I just want to do this for log and archive files...

View Article


Answer by Sundeep for find and remove files bigger than a specific size and type

find -type f \( -name "*zip" -o -name "*tar" -o -name "*gz" \) -size +1M -deletethe \( \) construct allows to group different filename patternsby using -delete option, we can avoid piping and troubles...

View Article

Answer by techraf for find and remove files bigger than a specific size and type

If you want to exclude files by name, you can use this syntax:find . -type f ! -name '*.mp3' ! -name '*.mp4' -size +1M -deleteor if your find does not support delete:find . -type f ! -name '*.mp3' !...

View Article

Answer by Matthew Hub for find and remove files bigger than a specific size...

Based on the above answers I used below command to clear the server from big log files (after cd'ing into /var/lib/jenkins)find -type f -name *log -size +500M -delete

View Article

Browsing index pages (8 articles)


Latest Images