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.

Install Python’s PIP Part Two

This article may also seem a bit unusual because I covered how to install Python’s PIP in the last article. This article is the second part of that. This is something that seemed like it should be two articles, so it is two articles.

Additionally, I share this information so that I can write future articles. So, by themselves, these two articles won’t accomplish much by themselves. They will come in handy for future reference and that’s the point of this.

In the previous article about how to install Python’s PIP, you learned the basics. In that article, you learned how to install PIP. That’s all well and good, but then you might be confused when you go to install a package installed by PIP.

During the package installation, you may see a warning that looks like this:

This is because PIP installs the packages somewhere like your ~/local/.bin directory. If you then try to run the package from the terminal, it won’t be found. 

For the record, this is for people using Bash. I’m not sure about other shells.

You can still use PIP packages just fine, you just have to specify the path. That’s a pain in the butt and not something you should have to do. Instead, we’re going to add the path as suggested. If you’ve done that, you can just type the package name into the terminal to run your PIP-installed Python applications.

So, let’s do that…

Install Python’s PIP Part Two:

By now it should be obvious that this requires an open terminal. You did read the first article, right? As such, you can usually open your terminal with your keyboard, simply press CTRL + ALT + T, and your default terminal should open.

With your terminal open, we need to add some text to your ~/.bashrc file that sets the path. It’s pretty straightforward and we’ll be using Nano for this. Click that link if you’re not sure if you have Nano installed.

Let’s open the file for editing with this command:

Then scroll to the bottom.

At the bottom, add a new line.

Copy and paste the following:

Next, we save the changes and exit Nano by pressing CTRL + X, then Y, and then ENTER on your keyboard.

No changes will have been made just yet. You could reboot or reload your desktop session if you wanted, but you can tell the shell to reload the file and thus have the changes take effect. To do that, you’d enter this:

At that point, you can install PIP packages and have them run when you just type the command into the terminal. There’s no need to add anything else to the command. This sets the path that PIP was complaining about.

And now you’re ready to install Python PIP packages. This is an important step after you install Python’s PIP. It should serve you well, assuming you want Python packages installed in a pretty simple manner.

IMPORTANT: Read Part 1 to install Python’s PIP.

Closure:

As you can tell by the length, there’s a reason that this is a second article. I’ll have to remember to edit the first article when this article gets published. It’s not that it’s complicated, it’s just long.

So, it seemed best to turn this into a second article – especially because it’s not technically a necessary step. You can comfortably run Python packages by using the file path, but this is much easier.

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.

Install Python’s PIP Part One

At first blush, today’s article may seem a bit weird – but I am writing this article to write future articles, so let’s install Python’s PIP. Yes, it may seem strange, but there’s a madness to my method! Yes, yes there is. 

Also, there’s going to be a second part to this article. I’ll link to it when it’s time.

This is something many of you may want to do, even if it doesn’t seem appropriate at this point. There are likely to be several future articles that refer back to this article. You’ll likely guess why after reading this article.

Python is a “high-level” programming language. To some of us, it’s one of the ‘new kids on the block’ but it has been around since 1991. It didn’t gain a lot of popularity until fairly recently, which might be why it seems more modern than it is. Well, to be fair, Python is modern. The language has been upgraded consistently.

So, what is PIP? It stands for PIP Installs Python, or maybe PIP Installs Packages. It depends on who you ask. Much like your regular Linux software, there are applications (written in Python) that can be installed from a central repository. This is, of course, done in the terminal – though I’m sure someone’s authored a GUI PIP installer. (Is ‘installer’ redundant?)

Now, here’s the thing… You can install PIP on pretty much every Linux distro out there. There are a zillion (and three) Python applications that can be trivially installed with PIP. This is a pretty good start at making some new and interesting software immediately available for your use.

So, this article is just going to cover how to install Python’s PIP in a variety of Linux distros. This will, of course, be in the terminal!

IMPORTANT: Read Part 2 to finish installing Python’s PIP.

Install Python’s PIP:

PIP is a terminal-based tool – to me.

Some searching sent me to this package to install Python’s PIP in a GUI. I’ve never tried it, so I can’t speak about the quality. Click the following link to learn more about using PIP in a GUI.

Use a GUI to Manage Python Packages.

Edit: I can’t actually make the above work. It also requires PIP to install it.

For the rest of you, it’s time to crack open your default terminal emulator. The majority of you can open the terminal simply by pressing CTRL + ALT + T. If that’s not an option, the shortcut to open your terminal will be in your application menu. 

Now, the syntax to install Python’s PIP is a bit varied. I can only cover those distros that I know about. If your distro isn’t covered, figure it out and let me know. If I make a mistake for your distro, you should also let me know that too!

I’m going to assume that you’re using a modern distro. There’s an older Python 2 PIP. Your modern distro should require Python 3’s PIP. So, we’ll make that assumption and run with it.

Installation Instructions for Python PIP:

Debian/Ubuntu/etc:

SUSE/OpenSUSE/etc:

Fedora/etc:

Arch/Manjaro/etc:

RHEL/CentOS/etc:

There are other ways to install Python’s PIP, I’m sure. Those directions should cover most of the more popular distros. I did a bunch of searching and that’s what I came up with to fill in what was already in my notes.

I hope the information I found is accurate because I tested only one of those commands and ran that command long ago. If you are a regular reader, you might want to go ahead with the installation at this point. You can be reasonably sure that other articles will reference this one – plus you get to enjoy the warm embrace of Python packages even without my help! (You can find ’em on your own.)

By the way, the installation syntax for Python applications via PIP is simple:

It’s that easy to install Python packages (via the terminal) when you have PIP installed. There are so many packages available and we’ll explore some of my favorites in the future.

Right now, I just wanted to prepare you for the task – and to write an article that I can refer back to, which will save me so much time. Can you imagine if I had to include this information in every article that referred to installing Python packages? Man, don’t underestimate my laziness!

IMPORTANT: Read Part 2 to finish installing Python’s PIP.

Closure:

Today’s article didn’t do a whole lot by itself. You didn’t end up with anything new, other than the ability to install Python’s PIP packages. (That ‘packages’ bit seems rather redundant!) Trust me when I say this will come in handy at some point in your Linux journey. Well, it’ll come in handy if you know about it and use it… It otherwise won’t come in handy. So, make it handy!

If you don’t want to wait for future articles, you can start exploring right now! Head to your nearest search engine and look for packages that can be installed with PIP. I’m almost certain that you’ll find at least some system utility that can be installed. You might even find some games that can be installed via PIP. You never know!

Seriously! Don’t wait for me! If you’re new to Python’s PIP, have fun with it! You can look around and find information on your own. I just facilitate things. Every article on my site could at least be figured out by reading other articles (and some documentation). You don’t need me for anything!

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.

How To: Install PIP In Linux

Today’s article is going to teach you how to install PIP in Linux. PIP is a reverse acronym meaning ‘PIP Installs Packages” and it’s a handy tool for the installation and management of Python applications. This article should be pretty short and easy for anyone to understand. 

This article is going to be pretty basic, merely telling you how to install PIP and not a whole lot more. The reason I write this article is because it needs to be written. I should also point out that Python is a programming language, though I’d expect most visitors to know that already. But, yes, this article needed to be written.

See, I wanted to tell you about a lovely piece of software (or three), but they all need to be installed with PIP. So, rather than write out the long installation instructions for various distros and package managers each time, I figured I’d make a single article that told you how to install PIP.

That’ll save some time and effort. I can refer back to this when those articles are written. There are many Python applications that can be installed with relative ease – just like you’re installing from your regular Linux repositories. PIP’s Python applications can be installed and uninstalled in the terminal while using PIP, so it’s quite easy.

So then, let’s learn how to…

Install PIP In Linux:

Installing PIP requires a 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.

Once you have the terminal open, you can install the appropriate PIP. Most folks will be using Python 3, but a smattering of people will still be using Python 2. I will list the installation instructions, where applicable, with Python 2’s instructions first.

Debian/Ubuntu/derivatives:

SUSE/openSUSE/derivatives:

Fedora/derivatives:

RHEL/CentOS/derivatives:

Arch/Manjaro/derivatives:

Slackware:

Read Install PIP For Slackwaare Instructions.

The basic usage of PIP is pip install <package>, pip uninstall <package>, and pip search <package>. My readers are smart enough to understand that without further instructions. You can also learn a lot by using man pip. Now you know how to install PIP in Linux.

Closure:

And there you have it. You have an article telling you how to install PIP in Linux, enabling you to install Python packages/programs quickly and easily inside the Linux terminal. It’s also one more article in my series of articles. I’m now well within a month of when the project is allowed to end and I still have a lot of articles left in me, so I’d expect it to keep going for long into the future. Or at least until someone steps up and takes the site over for me.

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: Start A Quick Python Server

Today’s article is going to show you how to transfer files between computers by using a quick Python server. It’s remarkably easy! It’s a temporary server (usually) and lasts only as long as you need it to.

Why would you do this? Well, you can transfer files from one computer to another. It also functions as an HTTP server which makes it easy to test things like simple web pages quickly and easily.

Are there better options? Quite probably. If you want to transfer a single file, then SCP is a good way to go about it. If you want to transfer multiple files, you could setup SFTP. If you want to test web pages, you can likely just write the files locally and then open them up with the browser of your choice.

You have options! And, thankfully, Linux provides all sorts of options – including setting up a quick Python server. As I said, it’s actually pretty easy.

A Quick Python Server:

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.

The first command I want you to run will let us know what version of Python you have installed. Many distros have (at present) moved onto version 3, but some still have Python 2 installed. So, for that information you just run:

Now, if you have Python v. 2.x, you would use this command:

If you’re using Python v. 3.x then the command you’d use is:

(If you’re curious, the -m is telling Python which module to open.)

Anyhow,  you can now connect to your server with the following command:

Read how to find your IP address. Instead of an IP address, you can also use your hostname.

Anyhow, you  now have a server running on port 8000. If you want to, you can also change the port number. This is the same for both commands. In both cases, just append your chosen port number to the command. Like this:

It’d look a little like this:

See? It's a different port number.
Note the changed port number. You should probably avoid reserved ports.

When you’re done with the quick Python server, you can just close it by pressing CTRL + C. If you’re planning on running it long term, you can always run the command with nohup. If applicable, you may also need to open the port in your firewall.

Like I said, it’s a quick and easy server in Python. You definitely wouldn’t want to use this as a public facing server, but it’s fine for quick tasks. Feel free to leave a comment letting folks know how you use this in  your day-to-day tasks.

Closure:

There you have it, another article said and done! The site is going well and the schedule seems to be working well enough. It’s a bit demanding to write one every other day, but that’s what I said I’d try to do. So far, so good!

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.

Subscribe To Our Newsletter
Get notified when new articles are published! It's free and I won't send you any spam.
Linux Tips
Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License.