To see the amount
of space available on all the mounted file systems on your Linux computer, type df with no options:
$ df
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/sda3 30645460 2958356 26130408 11% /
/dev/sda2 46668 8340 35919 19% /boot
/dev/fd0 1412 13 1327 1% /mnt/floppy
This example output shows the space available on the hard disk partition mounted on the / (root)
partition (/dev/sda1) and /boot partition (/dev/sda2), and the floppy disk mounted on the
175
Learning Basic Administration 4
/mnt/floppy directory (/dev/fd0). Disk space is shown in 1K blocks. To produce output in a
more human-readable form, use the -h option:
$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 29G 2.9G 24G 11% /
/dev/sda2 46M 8.2M 25M 19% /boot
/dev/fd0 1.4M 13k 1.2M 1% /mnt/floppy
With the df -h option, output appears in a friendlier megabyte or gigabyte listing. Other options
with df enable you to do the following:
Print only file systems of a particular type (-t type)
Exclude file systems of a particular type (-x type)
Include file systems that have no space, such as /proc and /dev/pts (-a)
List only available and used inodes (-i)
Display disk space in certain block sizes (--block-size=#)
Checking Disk Usage with du
To find out how much space is being consumed by a particular directory (and its subdirectories),
use the du command.
Pages:
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403