View Disk Usage

This article might seem like it has been written before but this is an entirely new way to view disk usage. To write this article I had to write two other articles. Tell me that that doesn’t sound like fun!

So, let’s see here… And, yes, I’m aware that they’re not disks anymore.

Yup. It’s official. There are too many ways to view disk usage in Linux – especially in the terminal. Why am I writing yet another article on the subject of disk usage? Because I can! I love showing how there are many ways to do the same thing in Linux. This is great because you can pick and use your favorite methods.

As for the subject of monitoring disk usage…

Monitor Disk Usage With GDU
Show Disk Usage With ‘ncdu’
A Few Ways To Visualize Disk Usage In Linux
How To: Check Disk Usage With ‘df’
Yet Another Way To Check Filesystem Space Use

Those are just the first five links when I searched for ‘disk usage’. That’s just five ways to check disk usage in Linux. I’m willing to bet that we can easily come up with five more ways to do this.

What’s special about this way of viewing disk usage?

Well, today we’ll be monitoring your drive space with a tool written in Python. You’ll need to enable PIP, a Python packaging tool. Once you’ve done that, this is universal. It will work in any distro that supports PIP – which, as you’ll see, is just about every major distro on the planet.

Read the following before going further:

Install Python’s PIP Part One
Install Python’s PIP Part Two

If you haven’t already installed Python’s PIP, this article will be of no use to you. You’ll need PIP enabled to proceed. You should also add the $PATH as defined in the second article. From here on out, the article will assume you’ve done both of those things.

View Disk Usage With Vizex:

The tool we’ll be using is known as Vizex. You can see the Vizex project page here. If you bother going there, you’ll see that Vizex is indeed the correct tool for the job. You’ll see that this is (one of the many) correct tools for the job.

vizex is the terminal program for the UNIX/Linux systems which helps the user to visualize the disk space usage for every partition and media on the user’s machine. vizex is highly customizable and can fit any user’s taste and preferences.

Hmm… It is at this point that I noticed that they don’t capitalize it. I’m going to capitalize it because it’s keeping the system from saying I didn’t spell it properly. 

Anyhow, as you’re using PIP, you’ll need an open terminal. You can use your GUI to open your terminal. On many systems, just press CTRL + ALT + T and your default terminal will open.

To install Vizex, run the following command:

If you’ve never installed a Python package with PIP before, then be sure to keep an eye on the screen. It’s a fascinating process and watching stuff happen in the terminal is pretty sweet!

Now that you have Vizex installed, you simply run that command in the terminal. If you didn’t follow the 2nd part of the Python PIP article you’ll have to specify the path. That’s just silly. Follow the 2nd article (it’s really easy) and you don’t have to deal with that. 

Using Vizex:

Anyhow, that command is simply:

It will even color-code your drives. If they’re close to full, they’ll be red and blink (missed in the screenshot below). If you’re moderately full, they’ll be listed in the yellow. I wanted to use Vizex to view a computer will all sorts of drives, so I did! That’s how you ended up with this screenshot:

using vizex to view disk usage
If this isn’t self-explanatory, I don’t know what is! It’s so simple that I can figure it out!

If that isn’t one of the easiest ways to view disk usage, I don’t know what is. This is just one of the many reasons why you should have Python’s PIP installed. There’s a bunch of software that’s available if you just know where to look. It took a while, but I finally got around to sharing this information. In my defense, it did take a couple of articles to share it properly.

Closure:

There are all sorts of ways to view disk usage. This is just another way, though it’s an interesting way. I’m quite sure that I’ll cover this very same subject again in another article. For now, I’ve covered a way to do so with Python and that’s something different than you’ve previously seen on the site.

I may not place ads on the site and just opt to accept sponsored articles as a way to cover the bills. That seems like a good thing to do. Some stuff may already be in the works, so look for that in the future. If you’re interested in sponsoring an article, be sure to hit me up. We get good traffic and rank well in the search engines. So, get some extra traffic and some SEO benefits by sponsoring an article!

Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

Monitor Disk Usage With GDU

I probably shouldn’t say ‘disk’ but I think we’ll all agree that we know what I mean and today we’ll monitor disk usage with ‘gdu’. It’ll be fun! It won’t even be all that complicated! Read on and learn how to monitor disk usage with gdu. It won’t hurt!

If you’re using your storage, you might want to monitor your disk usage. If you’re running low on disk space,  you might want to find out what’s using your disk space so that you can address that. Suffice it to say, that Linux is less than happy when you run low on disk space. Running out of disk space may even prevent system booting and you’ll have to go about it with a live instance, which nobody likes doing.

Oh, I’m sure I’ve covered this before. There are all sorts of tools you can use to monitor disk usage. Some are faster than others and gdu is not one of them. No, no… It’s not fast. But, it’s an option!

Speaking of options to monitor your disk usage, I’ve covered this before!

Show Disk Usage With ‘ncdu’
How To: Check Disk Usage With ‘df’
A Few Ways To Visualize Disk Usage In Linux
How To: Find Large Files Using ‘ncdu’

You might ask yourself why I’m covering this again. The answer is that I like to give you choices. The goal is to bring you up to speed, making you more efficient with your Linux usage. I want to make Linux more approachable for the novice (while still sharing stuff with the experienced users) and one of the ways to do that is to show you the variety of tools available. That way you can pick and choose among the choices. You can pick which works best for you.

In this case, we’ll be using an application known as GDU.

More On GDU:

The tool we’ll be using is known as ‘gdu‘. I’ll explain how to install gdu in Debian-based distros (like Ubuntu or Linux Mint), but you can find packages to install gdu easily. It’s easy to install, trust me.

I assume ‘gdu’ stands for ‘Go disk usage’, with ‘Go’ referring to the programming language and not for a space on a Monopoly board. It is a supposition because the man page and repository say nothing on the matter.

Once you do have gdu installed, you’ll be able to check the man page. Doing so will show you that gdu is described like so:

I might argue the ‘pretty fast’ bit but I’m too lazy to compare and provide actual data. It took quite a while when I ran the application with instructions to scan my entire system (complete with external drives). I got distracted but this is a timed output:

I don’t think it’s all that speedy – but it’s neat. So, there’s that. Which is nice.

Still, it’s the correct tool for the job. Well, it’s a correct tool for the job. As you can see from the links above, there are many correct tools for the job. This is just one of them.

So then, let’s get this installed and use it…

Monitor Disk Usage With GDU:

You know it’s true. This application is terminal-based so you’ll need an open terminal. As I’m writing this for Debian distributions, you can usually just press CTRL + ALT + T to open up your default terminal.

Your command will differ if you’re not using apt. If you’re using apt, you can install gdu with this command:

When you’ve installed gdu, you can navigate to a directory and run the command like this:

You can also run gdu with a specified directory.

An example output would look like this:

Checking disk space with gdu...
This is gdu in the terminal. You can probably figure it out from here. Yes, I have weird stuff.

You use your arrow keys to navigate. If you have any questions, press the question mark. There’s nothing advanced to it. If you wish to exit gdu, press CTRL + C and gdu will terminate properly.

Closure:

There you have it. You’re now using gdu to monitor disk usage. Well, you’re doing so in Debian-based distros. You’ll have to figure it out for your distro but they have packages and binary files available for others. It’s a pretty handy application, even though it’s not all that speedy.

Granted, as far as speed goes, I didn’t compare it with other applications. It doesn’t seem to be all that quick, but it does do the job as intended. It’s a handy way to visualize disk usage in the terminal and a tool worth testing.

Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

Show Disk Usage With ‘ncdu’

In today’s article, we’re going to learn how to show disk usage with ‘ncdu’. It’ll be a fun terminal exercise that lets you see your disk usage. I’d say this is on par with a beginner article, ’cause it’s just some simple terminal commands. So, do read on!

If you think ‘ncdu’ sounds familiar, it may be from a previous article. You should probably read the intro to that article, as it will save you some time and is reasonably informative.

How To: Find Large Files Using ‘ncdu’

We’ll be using that same tool, but we’ll be using it in a different manner. That article explains what ‘ncdu’ is. In short, it stands NCurses Disk Usage and it’s a handy enough tool. It describes itself as:

ncdu – NCurses Disk Usage

There are a few ways to use ‘ncdu’ and we’ll be using it to show disk usage in this article. Because you have that handy link up there, I’m going to skip some sections of this article.

Show Disk Usage With ‘ncdu’:

This article requires an open terminal, like many other articles on this site. If you don’t know how to open the terminal, you can do so with your keyboard – just press CTRL + ALT + T and your default terminal should open.

First, you’re going to need to install ‘ncdu’. Rather than duplicate work, please visit this article. Scroll down and you’ll see how to install ‘ncdu’. 

See? All these previous articles sure make some future articles easier.

Anyhow, now that you have ‘ncdu’ installed, just navigate to the root directory run ‘ncdu’ from the there.

Depending on how much disk space you have attached to your system at the time, it could take a while to run. Let it run and eventually you’ll end up with a screen like this:

ncdu in action
Pretty basic looking, right? Well, look deeper.

As you can see, the first line is highlighted. Well, use the arrow keys to move up and down. Then, use the left and right arrow keys to move back and forth. To keep it simple, if you want to dig deeper, just navigate to the directory you’re curious about and run ‘ncdu’ in that directory.

Hmm… I probably should have timed it. I set ‘ncdu’ running on a desktop with a couple of internal disks and attached to an external disk with a whole lot of files on it. It’s like an 8 TB disk and the system is still trying to process that bad boy.

ncdu can take a long time to run...
It has been a while… It’s okay, I have faith, It’ll finish someday!

Anyhow, read the man page:

There’s more to be done with ‘ncdu’ when you want to explore disk usage. It can take a minute or ten to run, but the information is worth it.

Closure:

There you have it, a fairly short article that explains how to show disk usage with ‘ncdu’. It seemed like a good article to write and it was nice having already covered so much of it. That saves some time and I was a bit late in writing this one.

Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your own site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

How To: Check Disk Usage With ‘df’

In today’s article, we’re going to do exactly what the title suggests; we’re going to check disk usage with ‘df’. This means we’ll be checking disk usage in the terminal. Seeing as ‘df’ is included with every distro on the planet (I’m pretty sure) it means this won’t be all that complicated.

I am still a bit under the weather, but the show must go on! I’ve gone this long without missing a publication date, so I might just as well keep the  streak up. 

As the title suggests, we’ll be using ‘df’ to check disk usage. This will already be installed as one of the default tools, so you won’t need to install it. That’ll save some time! If you’re curious, the ‘df’ tool describes itself as:

df – report file system disk space usage

If you want to get a head start, you can check the help page. To do that, you’ll want to run:

If you’re like to check the version, the command is:

So, with that in mind, let’s just jump into the article.

Check Disk Usage With ‘df’:

Obviously, this is yet another article where we’re learning about doing things in the terminal. That means you’ll need an open terminal. If you don’t know how to open the terminal, you can do so with your keyboard – just press CTRL + ALT + T and your default terminal should open.

With your terminal now open, you can just run the command by itself:

In some cases, it will throw an error and not be able to read everything. That’s usually easily resolved. Just run the command as a privileged user. So that would look like:

Now, you can use that output to do a bunch of math, or just pay attention to the percentages. Or, if you’re wanting, you can use the -h flag and get the output in human-readable format. That looks like:

The output of which might look a little something like this:

the output of sudo df -h
See? No errors and it is nice and readable! You can’t go wrong with that!

As you can see in the picture, I’m only using less than half of my available disk space. I don’t need to worry about running out of space any time soon, but if it gets low I can always check disk usage with ‘df’. Also, it doesn’t matter what directory you’re in when you run the command. As you can see, it runs just fine while in the Downloads directory.

I also wrote an article about using GUI methods to visualize disk space usage. You might prefer one of those methods, but you can always just use the terminal to check disk space.

Closure:

It seemed like a good idea to do a quick article tonight. I’m watching IMSA’s last race of the season and feeling poorly, so hopefully I get some sleep at a reasonable hour. Still, as I mentioned, the show must go on. The site has had a new article every other day for quite a while. I might as well keep up the schedule.

Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your own site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

How To: Find Large Files Using ‘ncdu’

In this article, we’ll learn how to find large files by using ‘ncdu’. It’s useful for spotting large files that eat up your disk space. We’ve previously had an article about visualizing disk usage. Those were some great GUI ways to find large file, but this will be done inside your terminal – and using ncdu.

You’ll find that ‘ncdu‘ stands for NCurses Disk Usage. As the link says, it refers to the similarity with ‘du’ and that it uses the [n]curses programming language. As far as tools like this go, this one is relatively new (from 2007). Unsurprisingly, ncdu defines itself as:

ncdu – NCurses Disk Usage

There are a ton of options for ncdu and we’re only going to touch on just one of ’em. The goal isn’t to teach you how to use ncdu, it’s to teach you how to use ncdu to find large files. If you want to learn more about the tool, you can always refer to the man page.

Now that we understand the scope of this article (how to find large files using ncdu) we can move on into it…

Find Large Files Using ncdu:

Chances are good that ncdu isn’t installed by default and you’ll need to install it. It’s also a text-based application. So, obviously, you’re going to need a terminal open. You can easily open a terminal by pressing CTRL + ALT + T. That should open your default terminal.

Now, you’re going to need to install ncdu, and one of the following commands should cover the most popular distros:

Fedora:

Debian/Ubuntu: 

Manjaro/Arch: (Note: Should work, threw PGP error in my testing VM.)

openSUSE/SUSE:

RHEL/CentOS: (Note: Needs epel-release.)

Or whatever… It’s available for any distro I could think of to check, and it’s trivial to install it. If you’ve been following this site long enough, you can figure it out. I have the greatest confidence in your ability to get it installed!

That said and done, all I’m going to teach you is how to use it with no flags or anything of the sort. Yup… I wrote all this just to show you a single use type of ncdu.

Basically, for the exercise today, all you need to do is change to the directory you’re curious about and then you’ll just run ncdu in that directory. So, as you just opened your terminal and installed ncdu, you can just run it right there in your /home/<user> directory. It looks like this:

If you want to run it on the root of your drive, just navigate to it and run ncdu all over again. Sure, you can specify the directory or you can just be a lazy bum and navigate to the directory and simply run ncdu without any flags at all.

If you run it in your home directory, it’ll just be the files that belong to you. But, you can navigate to any directory and just run the command. In your home folder, it might look a little something like this:

ncdu showing the directories in order of tile size.
See? It should be pretty self explanatory from here on out. Navigation is easy.

To navigate, you just use your arrow keys. Up and down to pick the directory, forward and backward to enter and exit the directories. For example, when I dig down into my VirtualBox virtual machines directory, I get a screen that’s even more informative. Like this:

ncdu showing the directories in order of tile size.
As you can see, you can dig down quite nicely and find the file sizes.

Anyhow, I’m sure you can figure this out. Use your arrow buttons and explore. Heck, go to the root directory and explore your system until you’re happy and content! Trust me on this one,  you have the capacity to figure this out.

Now, before I go, I’d be remiss in my duties if I didn’t strongly suggest you read the actual man page. There’s a whole lot more to this tool. Using it this way is kinda like using a hammer to bake cookies, or some other horrible analogy. But, it does work. It does give you the information you need. Best of all, it does it without any necessary complexity.

Closure:

And there it is! Yet another article is said and done. This one will show you how to use ncdu in the terminal to find large files. If you’re ever unable to use a GUI, this is an excellent tool to determine file sizes. You never know when you’ll need such a tool.

Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your own site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

Linux Tips
Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License.