Is your disk/partition full?
Posted: 22 Jan 2013, 12:41
We have had some tips here on how to remove stuff to free up space like the removing of "devel" files. But I did a check here and found nothing about how to find the biggest files and directories.
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:
You can specify the no. of lines to show by adding -n10 (show 10 lines)
We 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:
The "less" command makes the output "scrollable" (You go to the next page with <ENTER> and quit wih "q")!; one page at the time so that you do not have to scroll back for 5 minutes to get back to the top of the list.
If you want to check out your partitions you can simply replace du above with df like this:
If you are looking for a certain type of files in this directory you could do it like this:
This 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
And there are probably way better ways of doing this
So ... the stage is yours:

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:



