Thursday 22 September 2011

Linux - Find and delete large files in UNIX

On Red Hat Linux - To find the large files which could be removed to reclaim the space, execute the below command

 find / -size +155M -printf "%s - %p\n"

The above command is executed on root directory to find the files which are more than 155MB in size. Remember you will receive permission denied error if you run as other than root. To execute into a particular folder specify the folder name. For example to find in the usr directory,

find /usr -size +155M -printf "%s - %p\n"

The above command can be modified to find in the current directory as below

find . -size +155M -printf "%s - %p\n"

No comments: