Ahmad Awais

NAVIGATE


SHARE


How Do I Find the Amount of Free Space on My Hard Drive with Command Line?

Ahmad AwaisAhmad Awais

This is a quick-tip for Ubuntu users who’d like to find the amount of free space on their hard disk via command line.

FiguredΒ I’d post a quick-tip while enjoying the vacations and all. Since I am a command line power user, I like to do a lot through it. Having built a lot of CLIs and workflow automation β€” I can only tell you how happy it makes me being able to hack it through Command line.

Space Usage on Ubuntu#

So, let’s get to it. Β If like me all you need is the total of disk space used then just use the following command.

df -h --total

⚑️ Complimentary GIF β€” As they say, GIF or didn’t happen.

total disk space

Here’s a sample output with the total shown at the end

Filesystem      Size  Used Avail Use% Mounted on
udev            478M     0  478M   0% /dev
tmpfs           100M  4.5M   95M   5% /run
/dev/vda1        20G  3.3G   16G  18% /
tmpfs           497M     0  497M   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           497M     0  497M   0% /sys/fs/cgroup
tmpfs           100M     0  100M   0% /run/user/0
total            22G  3.3G   17G  17% -

Happy hacking β€” Cheers!

I help businesses understand developers πŸ“Ÿ Launching Node.js CLI Automation Course πŸ‘¨β€πŸ« Edutainer at VSCode.pro 🎩 An award-winning open-source engineer and developer advocate 🦊 Google Developers Expert for web 🌳 Node.js foundation Community Committee member ✌️ Author of various open-source dev-tools and software libraries used by millions of developers worldwide ⓦ WordPress Core Developer πŸ“£ TEDx Speaker πŸ™Œ Leading developers and publishing technical content for over a decade πŸ˜‚ Self-confessed tech comedian working with the JavaScript web and cloud communities πŸ’œ Loves his wife (Maedah) ❯ Learn more about Awais ↣

Say πŸ‘‹ on Twitter @MrAhmadAwais | Subscribe to the Developers Takeaway!

πŸ“¨

Developers Takeaway

Takeaway my professional opinion on open-source, developer relations, growing your business with family, and everything in between! Delivered to your inbox a couple of times every year. I'm even funny at times. I hate spam β€” pinky-promise!

πŸ‘¨β€πŸ’»πŸ‘©β€πŸ’» 115,834 Developers Already Subscribed