Shell – Files greater than 1 GB and older than 6 months

command linefilesfindshell-script

I want to find files which are greater than 1 GB and older than 6 months in entire server. How to write a command for this?

Best Answer

Use find:

find /path -mtime +180 -size +1G

-mtime means search for modification times that are greater than 180 days (+180). And the -size parameter searches for files greater than 1GB.

Related Question