Monday, February 23, 2009

df

df displays information about mounted filesystems. if you add the -T option, then the filesystem type is included in the display.



df -T
Filesystem Type 1K-blocks Used Available Use% Mounted on
/dev/sda1 ext3 76058116 11954216 60270796 17% /
varrun tmpfs 252996 120 252876 1% /var/run
varlock tmpfs 252996 0 252996 0% /var/lock
udev tmpfs 252996 64 252932 1% /dev
devshm tmpfs 252996 12 252984 1% /dev/shm
lrm tmpfs 252996 39780 213216 16% /lib/modules/2.6.24-21-generic/volatile
/dev/sdb5 ext3 242271360 30132684 199928880 14% /data
gvfs-fuse-daemon
fuse.gvfs-fuse-daemon 76058116 11954216 60270796 17% /home/zodiac/.gvfs
/dev/sdc1 vfat 1951200 8320 194288



to display inode usage

df -i -x tmpfs
Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/sda1 4792320 192604 4599716 5% /
/dev/sdb5 15269888 341 15269547 1% /data
gvfs-fuse-daemon 4792320 192604 4599716 5% /home/zodiac/.gvfs
/dev/sdc1 0 0 0 - /media/disk


if you aren't sure which filesystem a particular part of your directory tree lives on, you can give the df command a parameter of a directory name or even a filename
Ex:
df -H ~zodiac/myfile.txt
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 78G 13G 62G 17% /


Watching the disk space

If you want to repeat a command many times, for example you are monitoring something, then don’t forget about the watch command. It will print the results of the command to screen every 2 seconds (you can change the interval with -n).

watch --no-title "df -h"

No comments:

Post a Comment