It is a simple task and a very common task for a VPS user. You have a VPS, and want to know the disk usage of your data and system. You are also want to know which folder takes the biggest disk space.
The command is du
du takes a single argument, specifying a pathname for du to work; if it is not specified, the current directory is used. The SUS mandates for du the following options:
-a, display an entry for each file (and not directory) contained in the current directory
-c, display a grand total of the disk usage found by the other arguments
-d #, the depth at which summing should occur. -d 0 sums at the current level, -d 1 sums at the subdirectory, -d 2 at sub-subdirectories, etc.
-H, calculate disk usage for link references specified on the command line
-k, show sizes as multiples of 1024 bytes, not 512-byte
-L, calculate disk usage for link references anywhere
-s, report only the sum of the usage in the current directory, not for each file
-x, only traverse files and directories on the device on which the pathname argument is specified.
Above command usage method retrieved from Wikipedia.
The computer I mentioned here is Windows based. When you use it for one or two years, it will be slower and slower. Until one day, you want to buy a new replacement. Actually, you just need to do the clean up.
OK. Let me show you how I did for my daughters computer.
I use VPS about one year. There is Lxadmin running on it.
I found the files growing so fast. To remove some un-necessary files I did some research and got the answer.
1) Disable installapp to remove the installation files.
I do install all Open Source program by myself. I have never use installapp, so I decided to remove these.
Admin — general option — disable installapp
Then go to SSH, run following script, it takes a while.
This step can save about 1G.