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 :

Code:
$ df -h
OR
$ df -k
These commands shows following output :

Filesystem Size Used Avail Use% Mounted on
/dev/md3 1.8T 205G 1.5T 13% /
tmpfs 16G 100K 16G 1% /dev/shm
/dev/md1 496M 73M 398M 16% /boot
/dev/md2 5.0G 1.1G 4.0G 22% /tmp
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 :

Code:
$ du –sh
After entering the command you will get the following outputs :

In command –s option means space a directory and – h option means “human readable”.
Author
bhawanisingh
Views
20,432
First release
Last update
Rating
0.00 star(s) 0 ratings
Top