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!

Founder & CEO of ⌘ Command Code coding agent with taste. Founded Langbase.com, AI cloud to build, deploy, and scale AI agents with tools & memory · Creator of Command.new.

"Awais is an awesome example for developers" — Satya Nadella, CEO of Microsoft.

NASA Mars Ingenuity Helicopter mission code contributor 8th GitHub Stars Award recipient with 5x GitHub Stars Award (Listed as GitHub's #1 JavaScript trending developer). Google Developers Expert Web DevRel.

Ex VP Eng (DevTools & DevRel) Rapid · Google Developers Advisory Board (gDAB) founding member · AI/ML/DevTools Angel Investor (Replit, Resend, Daytona, Gumroad and you?) ❯ AI/ML Advisory Board San Francisco, DevNetwork.

Award-winning Open Source Engineering leader authored hundreds of open-source dev-tools and software libraries used by millions of developers, including Shades of Purple code theme and corona-cli.

Linux Foundation (Node.js Committee Lead), OpenAPI Business Governing Board. Taught 108K+ developers via NodeCLI.com and VSCode.pro course. 274 million views, blogging for 24 yrs.

❯ Read more about Ahmad Awais or come say hi on 𝕏 @_AhmadAwais.

📨

Developers Takeaway

Stay ahead in the web dev community with Ahmad's expert insights on open-source, developer relations, dev-tools, and side-hustles. Insider-email-only-content. Don't miss out - subscirbe for a dose of professional advice and a dash of humor. No spam, pinky-promise!

✨ 172,438 Developers Already Subscribed
Comments 4

Mentions

  • Ahmad Awais
  • ashik
  • Ahmad Awais
  • Stanislav