Disk Space Usage – Linux
Posted by admin | Filed under Computing and IT, Pick and Mix
What’s taking up all the space?
A command prompt try some of the examples I list below:
-
du –help
This shows all the parameters you can supply the “du” command with. Typical combinations I use are as follows:
-
du -h #human readable characters
-
du -c #grand total displayed at end
-
du * -s #summarise all folders
-
du * -sc #summarise and total
-
du * -scm #summarise, total, Mb
-
du /home/mydir #show the disk usage of a certain directory
-
du -ah | sort -n #display
-
du -sk .[A-z]* *|sort -n #all files and subs within current directory
-
du /home/mydir -sk .[A-z]* *|sort -n
-
du * -scm | awk ‘{print $1 "Mb >>> " $2}’ | sort -n #sorted and in a Mbytes
You can muck around with displaying it in Megabytes (-m), Bytes (-b), but there are limitations, like files under 1Mb get shown as 1Mb…
Another alternative I came across is:
-
find . -size +1M
-
find . -size +10M
If you’re interested in display usage a partition level, try the following commands:
-
df -h -T
Tags: command promp, disk, Linux, usage
