
Lorenzodarbonne
(usa Metamorphose)
Enviado em 21/10/2022 - 06:21h
Before you rush to find a fix, make sure there is a problem, to begin with. After all, if disk space has actually run out on your system, there is no need to panic. You can just remove unnecessary data to free up more space.
There are two Linux system commands for getting information about disk space – du and df. The du command estimates the disk space usage, while the df command analyzes the free space present on the disk. Using them in conjunction with sudo gives you an accurate report of how much space is actually available on the disk.
Let’s start with the du command. Its output can be rather long and cumbersome to go through, so we will use the -s and -h flags. -s summarizes the results, while -h ensures it is human readable. So enter the command sudo du -sh / where / points to the base directory.
Don’t worry about all the permission denied messages – that’s how it trawls through all subdirectories of the system. Depending on the size of the drive you may have to leave it running for a while, as it recursively goes through everything.
When du finishes scanning, it will output a simple list of directories alongside their sizes. For example, this is the output of the du command applied to an ordinary directory.
Now we will use df to see how much free space is available. The df command is much simpler to use since it only shows the mounted filesystems and their usage statistics. Once again, we will use the -h flag to make the output human readable.
https://www.myccpay.win/
sudo df -h
The idea is to tally the results of the du and df commands. Any discrepancy points to disk space that is not freely available despite not being used by any files or folders.