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.

Short: Fix Typos With A Caret

Today’s article is labeled ‘short’ for a reason, and that reason is that we’re just going to cover how you fix typos with a caret. If you’ve ever made typos in a terminal command, you might be interested in fixing typos with a caret. 

This is labeled ‘Short’ for a reason. I’m trying something new. It will be an intentionally brief article. If there’s any benefit to this, I’ll do more short articles in the future.

If you don’t know, the ^ character is a caret.

If you don’t know, you can fix typos with a caret. It’s not difficult and every single one of us has made typographical errors in a terminal command. That means each and every one of us can benefit from fixing typos with the caret character.

You might also be interested in:

Fix Terminal Command Mistakes

It’s really simple to fix typos with a caret. You’ll see…

Fix Typos With A caret:

This article requires an open terminal. Just press CTRL + ALT + T to open your default terminal emulator.

The syntax is as follows:

That doesn’t make much sense, I’m sure. Let me show you an example. We’ll use the ‘uptime’ command.

Let’s say you made a typo and instead of ‘uptime’ you entered:

This will, of course, throw an error. 

You can use the caret character to fix this. For example:

The output from those commands would look like this:

As you can see, you’re replacing uplime with uptime and using the caret character to do so. This is pretty simple and a great way to save typing time when you make a typo in the terminal – especially if it’s a long command.

It doesn’t need to be the first word or anything like that. Let’s make an example out of the following command:

This is, of course, going to throw an error. So, enter the following:

That will re-run the previous command but will substitute the changed text for the matching text in the erroneous command. It doesn’t matter where the typo is in the previous command. It can be anywhere within the command and doesn’t need to be the first word or anything like that.

Closure:

So, this is a short article. Indeed, it’s called a ‘short’ in the title. If it does well, we may see more of them. If it doesn’t do well, you can expect them to disappear without much of a wrinkle in time. They may catch on. I don’t know. I don’t dare speculate, so your opinions really matter in this case.

I do welcome your opinions on the matter. I also don’t mind typing short articles now and then. As far as I can tell, writing an article takes me about the same amount of time, regardless. So, do let me know your thoughts on the matter. Without you, the reader, this site is pretty pointless. Thus, your thoughts on the matter are of interest to 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 site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

Automate Updates In Linux Mint

Today’s article will be a fairly simple one and is limited to Linux Mint users as we learn how to automate updates in Linux Mint. That seems like a good idea to me. Ideally, this will continue working without any intervention, but we’ll see…

So, I’m not sure how long this has been an option. I only noticed it fairly recently. If you’re not already aware, you can automate updates in Linux Mint. It’s a pretty simple task and won’t require much more than a mouse – or maybe a terminal and then a mouse.

This can be a touchy subject. I’m firmly in the camp of immediately installing all updates. I want my system to be as secure as possible, which means applying the updates as soon as they are available. So far, this mostly appears to work.

Updates often come right before public disclosure and proof-of-concept samples. While it’s true that an update can bork your system, that’s easily fixed and such a rare thing that I don’t even consider it as a reasonable reason not to apply updates.

I also consider it my duty, my obligation, to keep my systems secure. An insecure system doesn’t just impact you. An unsecured computer can be used as a proxy, a command center, a spam relay, or a node in a DDoS attack, among other things. As a good netizen, I keep my systems updated.

So, why not automate that stuff when I can? 

Automate Updates In Linux Mint:

In your system tray, down on the right, look to see if you have an icon that looks like a shield. If you do not see the icon, press CTRL + ALT + T and type in mintupdate. Both of those things will open the Update Manager in Linux Mint.

At some point along this path, you’ll be asked to enter your password. Do so.

That will open this window:

to automate updates in Linux Mint, start with opening up the update manager
Your theme may mean this has different colors or whatnot, but it should look like this.

Next, you’ll click on ‘Edit’.

You need to click on the Edit button to move to the next step of automating updates in Linus Mint
This is a pretty easy step. Heck, they’re all easy steps! You’ve got this! I’m sure of it!

You next want to open Preferences and click on Automation.

You'll need to edit the preferences to automate Linux Mint Updates.
Just in case you’re confused, I added an arrow for you! (My CDN is going to hate me.)

When you’ve done all of this, you’ll face a new screen.

This new screen is where you edit your automation settings. This new screen is where you enable automatic updates in Linux Mint. It looks like this when I’ve configured it to my liking:

Enabling automatic updates in Linux Mint via the Update Manager preferences.
You can configure those however you like, but I enable all of them. You do you, I guess.

Make sure you have a viable backup process.

As you can see, I’ve chosen all the things. I’ve chosen to automate all the updating that I can do. If anything, I wish I could increase the frequency. I suppose I could set up a cron job for this, but a handy GUI is fine for this task. This way will also update Spices and Flatpaks. So, there’s that.

I’ve had this setting enabled for a little while now and I’ve verified that it has been working as expected. If you want to automate updates in Linux Mint, you can do that – and it’s not even difficult.

Update:

No, it doesn’t appear to update Flatpaks. I’ve given it a few tries and it does not.

flatpaks are not automatically updated
I’ve waited and waited a few times. You have to update Flatpaks manually. So, there’s that…

Closure:

I like automatic updates. I use that sort of feature online with my various websites. Scheduled updates performing themselves is a good thing to me. You may be more cautious, but I throw caution to the wind. I haven’t had an update nuke my system beyond a 2-minute repair job in forever. I haven’t even had a 2-minute repair job in years. That’s good enough for me. You can make your own choices. Regardless of your choices, be sure to backup your system regularly.

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.

Create A New User In Linux

If you’re familiar with Linux, you’ll already know that Linux is a multiuser system and today we’ll learn how to create a new user in Linux. This shouldn’t be a very complicated article. In some more advanced operations, you may be required to create a new user. This article will be about that.

If you aren’t already aware, you have a whole lot of users on your Linux system. You have more users than just your user account and certain things can be done by certain users. You can generally use an elevated account (or sudo) to overcome those user restrictions.

There may come a time when you want to share your device with another person. So, there’s another reason to create an additional user. If you’re managing a server with multiple users, there’s another reason to create a new user in Linux. There are any number of reasons why you’d like to create a new user and we’ll go over that process today.

We’ll just be using a couple of tools today. It’s not complicated.

useradd:

The main tool we’ll be using is the useradd command. This is a tool that’s certainly installed by default on any major distro. It’s a part of the basic building blocks we use to manage Linux, so this doesn’t require any installation. You can verify that you have useradd available with the following command:

The output should be:

If you check the man page, you’ll see this:

useradd – create a new user or update default new user information

So, as our goal is to create a new user, you can see that this is the correct tool for the job. I can’t think of a better tool for the job, as it should do everything behind the scenes as well.

passwd:

We’ll also be using the passwd command. This isn’t strictly necessary, but it’s in your best interest to set a user’s password. Once again, you won’t need to install anything and the following command will confirm that:

The output should match this output:

The text alone should let you know that this is a tool for setting passwords, but you can always refer to the man page to learn more. This is how passwd is described:

passwd – change user password

As I said, you don’t have to undergo this step but it’s in your best interests, from a security standpoint, to assign passwords to users who have any access to your system. And, as you can see, this is the right tool for the job of setting a user’s password.

Create A New User In Linux:

Of course, this is done in the terminal. As a general rule, you can press CTRL + ALT + T and your default terminal should open. That’s a fairly common shortcut that I mention often. You can also find a terminal in your application menu, pretty much regardless of which desktop environment you’re using and whichever Linux you’re using.

Creating The New User:

With your terminal now open, you’ll need to use elevated privileges, and the syntax is quite simple. To create a new user in Linux, the syntax follows:

This should be lowercase as Linux doesn’t like capital letters in usernames. So, for my username, the command would look like this:

You can confirm that you’ve added the user with the following command:

For example:

With your user firmly in place, you should set a password. Let’s do that next.

Set A Password For Your New User:

You’re almost always going to want a password for your new user. That’s easily done and also requires elevated permissions. You’ll need to continue using the terminal when you want to set a new password for the user.

The syntax for setting a password for your new user is as follows:

After you authenticate, the system will have you type in the password twice. It does this to ensure you’ve not made a mistake while typing, though it could be that you’ve made the same mistake twice.

So, be careful with this step. Otherwise, you have to find some way to reset the new user and the quickest way to do that would be to delete the user and start again.

Closure:

Yeah, I guess this counts as a short article. My most recent articles have been longer than this one. This one is about the length of my earliest articles, maybe slightly longer. The site has evolved!

Anyhow, you’ve learned how to create a new user in Linux. It shouldn’t matter which distro you’re using. The kernel you’re using shouldn’t impact this at all. It shouldn’t even matter what shell you’re using, this should simply work. If you want to create a new user, this is how you do it.

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.

Meta: The State Of Linux Tips #22

I don’t want to write a meta article today, but I said I would. I don’t prefer them, but I started writing them and continue to write them. Sometimes, though more seldom than not, they’re a small break between other articles. However, they’re mostly just a waste of time and energy.

But, I said I’d write this one today. By pure luck, it’s also a fine time to wrap up the end of 2023.

See…

THIS IS THE 500TH ARTICLE ON LINUX-TIPS!

That’s right. I’ve published 500 articles, many of them at an acceptable standard! Some have been abysmal and others are hits in the search engine results.

When I started this project, I did not know I’d keep it going this long. Even when Mother Nature conspired against me, which she’ll be doing again this coming Wednesday, I was able to cheat and at least claim that I had an article published. They were garbage, but they were articles that informed. They told you why you were getting no articles!

Mother Nature is entirely to blame. She does what she wants and there’s not a whole lot we can do to stop her when she’s bent on causing destruction. It is what it is, I suppose. Given my geographical location, I’m surprised that Mother Nature hasn’t caused more trouble. So far, we’ve been fairly lucky and able to get articles published.

 A Quick Blurb About 2023:

So, in 2023, we experienced a 61% increase in unique monthly visitors and we experienced a 68% increase in monthly visitors.

Combined, we’ve used more than .5 TB of traffic. CDN traffic was about 350 GB of traffic. Backend traffic was about 135 GB of traffic. That’s a lot of bits and bytes! 

Linux-Tips received $25 in donations over the year. This is definitely not a get-rich scheme. Any ad revenue goes straight to the CDN provider. Fortunately, they’re not all that expensive. You buy credits ahead of time and I’ve got a solid chunk of credits, though they’re wearing them down. It’s a new year, so I’ll add some more credits soon.

Google sent more than 116,000 visitors to Linux-Tips.
Google also accounts for (Chrome/Chromium/clones) 80% of the browsers.
Firefox is about 3.5% of the browsers.

Sites besides Google send me traffic!

Linux.org sent me more than 17.5k unique visitors and more than 51k visits.
Reddit sent me just 894 people – but they’re sort of 2nd on the list.
The real 2nd on the list is the old .gq site, but we’ll ignore that.

Here Are The Leading Articles:

Find Out Which Display-Manager You’re Using
Screenfetch vs. Neofetch, You Decide!
How To: Restart TeamViewer From The Terminal

What an odd assortment. You never know what search engines are going to like and you never know what people will be searching for. Ah well…

I also get some weird search engines.

You spend an average of 246 seconds on a page.

Most of you are from the US.
Most of you are technophiles.
Many of you are professionals.
Many of you are middle-class or higher.

I Get Other Traffic:

I get traffic from places I didn’t think I’d get traffic. These are some of the odd search engines out there, some of which give good results…

DuckDuckGo sent more than 6k visits.
StartPage sends about half of that.
Yandex sent about 1k.

I wasn’t indexed in Bing until recently. They sent like 500 people.

Those are tiny fractions of the overall traffic, but that’s okay. I’m happy to be helping people from all over the world. I even get traffic from China’s search engine.

The top 3 countries that send traffic would be:

United States Of America
Russia
India

However, that includes malicious traffic. The majority of malicious traffic also comes from (or uses a VPN and appears to be from) two of those countries. I’ll leave it to the reader to pick which two and I’ll leave it to the sociologists to decide why that is. We will not be digging into it in this article.

And, man… I get a lot of malicious traffic.

Just for one example, I’ve (not personally, it’s automated in many ways) dealt with more than 60,000 spam attempts in 2023 alone.

In just 24 hours, the site will be attacked 2,500 times – excluding spam attempts. Sometimes this number will double.

Don’t worry. This place is a fortress. You can knock on the door all day long and we should be good to go. And people do just that… They knock loudly and often! I use a multi-layer defensive system that has so far prevented unauthorized access. 

Closure:

So, yeah… It takes longer to write this sort of article than it does to write a regular article. There are all sorts of other facts and figures I could share, but that’s enough for an overview and I don’t want to invest that much time. I’ve invested enough in an article that’ll be appreciated by a few dozen people.

I think the important takeaway is that this is the 500th published article on Linux-Tips. If it wasn’t for your readership and encouragement, I’d have quit this long ago. So, thank you! Thank you to those who read and comment.

Thank you to those who contributed thoughts, insight, additional information, donations, and ad revenue. Every little bit goes into the CDN kitty. LOL It’s not enough to pay for the base hosting, so I just kinda ignore that and it’s automatically deducted so I don’t think about it.

It will be a while before we’re at 1,000 articles – but we just might get there. I suppose our next major milestones will be 600 articles and the 3-year mark. The 3-year mark is coming right up. It will be in April. It’s hard to imagine that I’ve been doing this for that long, but I have proof that I have! I have lots and lots of proof that I’ve been doing it for this long.

Heck, I can use this as proof in a courtroom. “No, your honor. If you look at my life you’ll see that I don’t have time for committing crimes! I’m too busy doing other stuff! A giant portion of my time is spent with the Linux community.”

I think that’d work in any reasonable court!

Ah well…

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.

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