Blog → Post


(TIP) Finding Large Files
...tips to ease the move to Linux
by @News, march 13, 2019, 12:09am utc

Finding the largest file using the command line:

Within a given folder
$ ls -rSl -h

In all folders, but only sorted BY biggest to smallest within each folder.
(that is, you can't sort a whole drive biggest to smallest with ls.)

$ ls -rSl -h -R

The following find command will recursively find all files (that's the type f parm) in all sub directories of ".". "." is your current folder &emdash; you can specify a different folder here. du -h is run. du shows disk usage and the -h parameter gives human readable results. So for example, 1.1G instead of 1138884 thousand bytes.

Finally the output piped ("|") through a filter to be sorted again.

$ find . -type f -exec du -h {} + | sort -r -h

tags: All users, Tips
Footer done in Inkscape