About Linux FAQ

Browse More FAQs:

Howto find out or Learn harddisk size in Linux or UNIX

Posted by Vivek Gite [Last updated: August 16, 2007]

Q. How do I find out or learn hard disk size in Linux?

A. Under Linux and UNIX you can use df command. df command displays the amount of disk space available on the file system containing each file name argument. If no file name is given, the space available on all currently mounted file systems is shown.

Task: Display hard disk partition size

$ df

Output:

Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/hdb1             19228276  14699744   3551784  81% /
tmpfs                   384300         4    384296   1% /dev/shm
/dev/hdb5             27917308  23883184   2615988  91% /data/network

Task: Display hard disk partition size in Mega bytes

$ df -H

Output:

Filesystem             Size   Used  Avail Use% Mounted on
/dev/hdb1               20G    16G   3.7G  81% /
tmpfs                  394M   4.1k   394M   1% /dev/shm
/dev/hdb5               29G    25G   2.7G  91% /data/network

Task: Display TOTAL hard disk size

fdisk command is partition table manipulator for Linux. But it can be use to display total hard disk site. You must type the following command as the root user:

# fdisk -l | grep Disk

Output:

Disk /dev/hda: 20.0 GB, 20060651520 bytes
Disk /dev/hdb: 80.0 GB, 80060424192 bytes

E-mail this to a friend      Printable version

Related Other Helpful FAQs:

Leave a Reply

We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

Tags: , , , , , , , , , , , ,

Copyright © 2006-2008 nixCraft. All rights reserved - TOS/Disclaimer - Privacy policy - Sitemap - Powered by Open source software.