Linux 101: How to find drive space usage from the command line

3 months ago 14
PR Distribution

If you request to cognize however overmuch abstraction remains connected those drives connected to your server, the accusation is but a speedy bid away. Jack Wallen shows you how.


Image: iStockphoto/TimArbaev

How overmuch abstraction remains connected your Linux server hard drives? It's not a instrumentality question, and it's 1 you should instantly cognize however to answer. 

Of course, if you usage a web-based instrumentality similar Cockpit, which gives you a speedy heads up arsenic to however overmuch section retention abstraction has been used, the task is precise straightforward. Or possibly you've installed a GUI connected your servers and tin usage a record manager to observe this information. 

SEE: The champion programming languages to learn--and the worst (TechRepublic Premium)

But what if your servers don't usage a GUI and you've not acceptable up a web-based power panel? Where past bash you crook to uncover the details connected however overmuch thrust abstraction has been used? Fortunately, there's an easy-to-use bid that volition contiguous this accusation to you successful a elemental format. 

The bid is df and reports record strategy disk abstraction usage. Df stands for "disk free," and makes it casual for you to spot however overmuch abstraction is successful usage connected each of your connected disks oregon a circumstantial disk. 

When you contented the df bid you'll spot six columns: Filesystem (which is the determination of the thrust successful question), Size (which is the full retention abstraction connected the drive), Used (which is the magnitude of abstraction utilized connected the drive), Use% (which is the percent of the abstraction utilized connected the drive), and Mounted connected (which is the directory the thrust is mounted on). 

The bid is simply df. If you tally it arsenic such, it'll show everything successful 1K blocks, which isn't each that understandable. If, however, you contented the bid df -h, everything volition beryllium successful a human-readable format. 

Or, if you lone privation to presumption the stats for a circumstantial drive, you'd contented a bid similar df -h /media/jack/TOSHIBA (substituting the Mounted connected determination for the thrust successful question). 

Listing retired a azygous thrust tin marque it overmuch easier erstwhile you person a server filled with drives. The df bid is elemental to use, but if you request a spot much power, marque definite to work the antheral leafage (by issuing the command, man df) to find retired what much it tin bash for you.

Subscribe to TechRepublic's How To Make Tech Work connected YouTube for each the latest tech proposal for concern pros from Jack Wallen.

Open Source Weekly Newsletter

You don't privation to miss our tips, tutorials, and commentary connected the Linux OS and unfastened root applications. Delivered Tuesdays

Sign up today

Also see

Read Entire Article