Skip to main content

Ubuntu - Check diskspace

df shows you the percentage per volume which is in use - but to clean up your diskspace it's much more practical to see the directories which are filled with 'tons' of filegarbage ...

Use the following command to check used up diskspace per directory:

sudo du -hsx /* | sort -rh | head -n 40

To check directory size only in home directory:

sudo du -hsx ~/* | sort -rh | head -n 40
 

To empty your trash on console goto:

cd .local/share/Trash/

ls

cd files

ls

rm -rf *

To be careful: Check with ls that you are really in Trash and delete only the files you want ...