Quantcast
Channel: find and remove files bigger than a specific size and type - Unix & Linux Stack Exchange
Viewing all articles
Browse latest Browse all 4

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

$
0
0

If you want to exclude files by name, you can use this syntax:

find . -type f ! -name '*.mp3' ! -name '*.mp4' -size +1M -delete

or if your find does not support delete:

find . -type f ! -name '*.mp3' ! -name '*.mp4' -size +1M -exec rm {} \;

Viewing all articles
Browse latest Browse all 4

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>