I'm trying to find out which folder in my VPS take the most of disk usge, the result of df -h command show that my disk storage has 40GB and I used 38 Gb.
But when I calculate the size of root folder using ncdu (using command: ncdu /), it show that I only used 8.9 Gb: Can anyone help me to figure out which files/folders take nearly 30 Gb of my disk
Try using this command:
du -cks *|sort -rn|head
This will list the 10 largest subdirectories of the current directory you're in. Then you can cd
into the largest subdirectory and run the command again to see the sizes of the sub-subdirectories, and so on.