Unix/Linux : How to find out the hard disk size?
It is easy to find out the available or used up hard disk space in a Graphical User Interface environment such as MacOSX or KDE. However, it is not so easy to find out the available or used up hard disk space in terminal or command line. Since I work mostly with ssh shell and vi, I need to find out the hard disk usage information with command line application.
How to find out the used and available hard disk size in Unix/Linux OS terminal?
Use the df -h
command.
df -f
Sample output :
guest@porteus:~$ df -h
Filesystem Size Used Avail Use% Mounted on
aufs 2.3G 205M 2.1G 9% /
devtmpfs 1.9G 20M 1.9G 1% /dev
/dev/sda1 100M 25M 76M 25% /mnt/sda1
/dev/sda2 298G 43G 256G 15% /mnt/sda2
/dev/sdb1 7.3G 1.7G 5.7G 23% /mnt/sdb1
/mnt/live/run 1.9G 176M 1.8G 10% /run
See also : Unix/Linux : How to archive and compress entire directory ?
By Adam Ng
IF you gain some knowledge or the information here solved your programming problem. Please consider donating to the less fortunate or some charities that you like. Apart from donation, planting trees, volunteering or reducing your carbon footprint will be great too.
Advertisement
Tutorials
+7.6k Golang : Regular Expression find string example
+26.5k Golang : Find files by extension
+5.6k Unix/Linux : How to open tar.gz file ?
+13k Android Studio : Password input and reveal password example
+5.6k CodeIgniter/PHP : Remove empty lines above RSS or ATOM xml tag
+24.9k Golang : Get current file path of a file or executable
+18.3k Golang : Display list of time zones with GMT
+14.9k Golang : How to get Unix file descriptor for console and file
+10.1k Golang : Meaning of omitempty in struct's field tag
+6.9k Ubuntu : connect() to unix:/var/run/php5-fpm.sock failed (13: Permission denied) while connecting to upstream
+3.4k Java : Get FX sentiment from website example
+11.1k Android Studio : Create custom icons for your application example