Wednesday, May 4, 2016

[Quick Tips: DU]: How to find large files and directories in Linux

How to find large files and directories in Linux

This is a command string I learned awhile back that always comes in handy.

du -c |sort -rn |head

Optionally qualify the directory you want to search in, say:

john@ubuntu15:~$ sudo du -c /var |sort -rn |head

624688    /var

624688    total

383784    /var/lib

323144    /var/lib/apt

323092    /var/lib/apt/lists

179464    /var/cache

159500    /var/lib/apt/lists/partial

155556    /var/cache/apt

69332    /var/cache/apt/archives

39728    /var/lib/dpkg

No comments: