A Blog Of Random Coding Techniques & Experiments Robert Askam

Useful Linux Commands to sort, list and find in directories Post Useful Linux Commands to sort, list and find in directories 9 months ago

A list of some useful Linux commands to sort, list and find in directories.

Top 5 largest directories in a folder

$ du -a | sort -n -r | head -n 5

Display the Top 100 newly modified directories

$ ls -lt | head -n 10

Total size of each directory

//To print on screen 
$ du -sh *
//To output to a file
$ du -sh * > filesizes.txt