Do you want to check disk space on CentOS 7? As we already know that CentOS is Linux command based operating system, if you are a beginner then it’s not that easy for you. As a beginner if you don’t know how to check free disk space on Linux server then you have to follow this article. In this article you can find commands for both Linux and Unix server.
There are two commands from which you can check free disk space. You have to enter these commands and can check disk space in Linux and Unix server. These commands are best of you have root access of server.
1. df command : df command displays the amount of free disk space which is available on file system. This command displays each file name argument.
2. du command : The du command list all the contents and files which their sizes. This command is useful to track space hogs.
How to use df command ?
If you want to check free disk space then you have to use this command and can check free file space on file system. For that you have to type command like this :
These commands shows following output :Code:$ df -h OR $ df -k
In this command –H option is for “human readable” output. From this command you can check the free disk space with suffixes : Byte, Kilobyte, Megabyte, Gigabyte, Terabyte and Petabyte.
How to use du command ?
With du command you can check how much space files and directories are using. For that you just have to enter the following command :
After entering the command you will get the following outputs :Code:$ du –sh
In command –s option means space a directory and – h option means “human readable”.