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
+6k Golang : How to write backslash in string?
+4.6k MariaDB/MySQL : Form select statement or search query with Chinese characters
+6.8k Golang : Calculate BMI and risk category
+11.3k Golang : Format numbers to nearest thousands such as kilos millions billions and trillions
+11.8k Golang : Clean formatting/indenting or pretty print JSON result
+10.1k Golang : Text file editor (accept input from screen and save to file)
+7.6k Golang : Lock executable to a specific machine with unique hash of the machine
+22.5k Golang : Set and Get HTTP request headers example
+5.1k Golang : Print instead of building pyramids
+10.4k Generate Random number with math/rand in Go
+8.6k Golang : Find duplicate files with filepath.Walk
+16.4k Golang : Merge video(OpenCV) and audio(PortAudio) into a mp4 file