Apr 17 2017

Find And Delete Files Greater Than Given Size on Linux

Category: Linux & UnixFatih Acar @ 19:56

If you want to delete files which are greater than given size on Linux, you can use below examples by changing as your need.

Delete Files

Delete files which are size more than 2 MB. and type is jgp.

[root@testserver ~]# find /tmp/ -type f -size +2M -name “*.jpg” -exec rm -rf {} \;

Delete files which are size more than 2 MB low than 5 MB. and type is jpg.

[root@testserver ~]# find /tmp/ -type f -size +2M -size -5M -name “*.jpg” -exec rm -rf {} \;

Delete files which are size low than 10 MB. and type is zip.

[root@testserver ~]# find /tmp/ -type f -size -10M -name “*.zip” -exec rm -rf {} \;

2,505 total views, 10 views today

Tags: Linux Administration, System Administration

facebook comments:

Leave a Reply

Time limit is exhausted. Please reload CAPTCHA.