Linux how to find large directories
When you get message “no space left on device” you need to find where all free space gone. To do this I use command du – which stands for disk usage
This command will tell size of directory it is run in
I start investigating from root directory “/”. Add flag -d1 which tells du to count only first level directories
This command may take some time to calculate directories size. In case of lots of files it may take serveral minutes
You can see which directory is largest one. In my case its /var
Now run same command but in /var directory
In my case /var/www and /var/lib takes up most space