Pages

Thursday, February 14, 2013

Free Disk Space / Disk usage on Linux


Q. How do I check free disk space in Linux or UNIX operating system? I've migrated from Windows NT to Linux and looking forward to get more information about free disk space.
A. Both Linux and UNIX offers two commands for checking out free disk space:
(a) df command : Report file system disk space usage
(b) du command : Estimate file space usage

df command examples - to check free disk space

Type df -h or df -k to list free disk space:
$ df -h
OR
$ df -k

Examples

linuxServer:/ # df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda2            109038804  82892008  20610028  81% /
udev                   3864264        92   3864172   1% /dev
/dev/sda3             10079572   5955024   3612484  63% /home


or you can run this command to get the file sizes at depth 1
# du -hc --max-depth=1


Thanks

No comments:

Post a Comment