web analytics

Author Archive

How to find biggest files in directory.

Written by config on . Posted in Linux, Mac OSX

Advertisement

Something you probably have to do now and then is to find the biggest files in directory to delete / destroy / eliminate or explode the damn space wasters. Here is one of the ways to find it:

ls -lSrh

The “r” switch will cause all the large files to be listed at the end and the “h”switch will make your life easier and will show you human readable data (MB etc..). You could also search for the biggest AVIs for example:

ls -lSrh *.avi

You can also check what are the largest directories with this one:

du -kx | egrep -v "\./.+/" | sort -n