Linux: Find Out How Much Disk Space Left On Hard Drive
I am a desktop support professional with experience working in a corporate call center environment. Recently, I started to admin RHEL based IBM Linux server. How do I determine how much disk space left in my Linux server? How do I find out how much disk space I have in Linux for each partition?
You need to use the df command. It shows the amount of disk space available on the currently mounted file system. df is used to show or find out following information:
Used and available space.
File system mount points.
File system capacity.
The number of inodes available.
Find of whether there is sufficient space to upgrade or install new apps.
Type the following command: # df # df -H Sample outputs:
The following example will provide information only for the partition/device that contains the /home directory: # df /home # df -h /home To see inode usage instead of block usage, type: # df -i # df -i / # df -ih / # df -i /dev/md0 Sample outputs:
-a, --all include dummy file systems
-B, --block-size=SIZE use SIZE-byte blocks
--total produce a grand total
-h, --human-readable print sizes in human readable format (e.g., 1K 234M 2G)
-H, --si likewise, but use powers of 1000 not 1024
-i, --inodes list inode information instead of block usage
-k like --block-size=1K
-l, --local limit listing to local file systems
--no-sync do not invoke sync before getting usage info (default)
-P, --portability use the POSIX output format
--sync invoke sync before getting usage info
-t, --type=TYPE limit listing to file systems of type TYPE
-T, --print-type print file system type
-x, --exclude-type=TYPE limit listing to file systems not of type TYPE
The author is the creator of nixCraft and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.