Find large directories
Use this simple command to find large directories. To find directories over 1GB
[root@localhost]# du -h / | grep ^[0-9\.]*G
G can be replaced with M if looking for MB instead.
To find directories over 10GB and sort the output with the largest directories on top
[root@localhost]# du -h / | grep ^[1-9][0-9][0-9\.]*G | sort -rn
To find files within a size limit.
find /etc -size +100k -size -150k
Find files under /, and do not cross filesystems. This will keep you from searching pesky nfs and san mounts.
find / -name -depth +100k
Show directory sizes using du
du -sk /usr/*
Find the largest 10 files
find / -size +15M -printf "%s - %p\n" | sort -n | tail
[root@localhost]# du -h / | grep ^[0-9\.]*G
G can be replaced with M if looking for MB instead.
To find directories over 10GB and sort the output with the largest directories on top
[root@localhost]# du -h / | grep ^[1-9][0-9][0-9\.]*G | sort -rn
To find files within a size limit.
find /etc -size +100k -size -150k
Find files under /, and do not cross filesystems. This will keep you from searching pesky nfs and san mounts.
find / -name -depth +100k
Show directory sizes using du
du -sk /usr/*
Find the largest 10 files
find / -size +15M -printf "%s - %p\n" | sort -n | tail
Comments