Now this is probably because everybody knows how to do it, but I thought I should write down some ways of doing it (and start a landslide of suggestions on better ways of doing it).
Let us start with finding the biggest directories sorted with the biggest on top:
Code: Select all
du | sort -nr | head
You can specify the no. of lines to show by adding -n10 (show 10 lines)
Code: Select all
du | sort -nr | head -n10We are using the pipe "|" to pass arguments from one command to the next. The head command only shows the head of the list so if you want to see the entire (and probably very long) list you can do it like this:
Code: Select all
du | sort -nr | less
If you want to check out your partitions you can simply replace du above with df like this:
Code: Select all
df | sort -nr | lessIf you are looking for a certain type of files in this directory you could do it like this:
Code: Select all
find *.txt| sort -nrThis will show all your .txt files sorted from the biggest to the smallest.
To find everything beginning with "berserk" in the current directory with sub-directories
Code: Select all
find berserk* | sort -nr |lessAnd there are probably way better ways of doing this
So ... the stage is yours:



