Let’s Update Ubuntu In The Terminal

Today’s article will be a nice basic article, where we discuss how to update Ubuntu in the terminal. It seems like a fine article to write and one that not everyone will be versed in. There are lots of folks who don’t use the terminal for much of anything. Then, there are people like me who use the terminal for all sorts of stuff.

If you know how to update Ubuntu in the terminal, this really won’t be a very interesting article. We’ll just be covering the basics and I’ll explain how I do it. You’ll see that I tend to throw caution to the wind and just blindly hope for the best. This strategy is fine for me, ’cause I can fix pretty much anything. (I can fix pretty much anything because I’ve broken pretty much everything.)

Of course, this article applies to Debian. This article applies to Linux Mint. This article should apply to anything that uses apt as the package manager. So, if your distro is related to Debian then this will probably work just fine for you.

Well, there’s no reason to make the intro any longer… I think I’ve covered all that you need to know to get started.

Update Ubuntu In The Terminal:

As you can guess, we need an open terminal if we’re going to update Ubuntu in the terminal. That only stands to reason… Press CTRL + ALT + T and your default terminal should open.

With your terminal now open, let’s update the list of software that’s available. Let’s see what software can be updated. To do that, you just run:

That will tell you the software that’s available to update. You can see what those updates are with the following command:

You can then upgrade those applications one by one if you want to. Some cautious people do this. Some businesses do this – and do this to a staging environment to test – ’cause they need to keep things running. If you want to upgrade just a single package, try this:

Now, most folks are probably going to want to upgrade all the software that has new versions. They get it easy, they just type:

This will give you the chance to see everything that’s going to be upgraded and the chance to decline or agree. Me? I automatically agree. You might want to be more cautious, but I like running the command closer to this:

That automatically says yes that I’d like to upgrade all the things. After all, even if stuff were to break, I’d have had to have upgraded to find it anyhow. 

I go a step further and just tie the two commands together. The command I run would look closer to this:

That will find all the available upgrades and install them automatically, that is without any further input from me. I’ve done this for years and it hasn’t been a problem or any more of a problem any other method would cause me. So, in short, that works for me.

Closure:

I don’t know that you wanted to learn how to update Ubuntu in the terminal, but that’s today’s lesson. It’s not very complicated. I could keep going, as my actually command also includes the ‘clean’ option. I use an alias to tie it all together, rather than typing it out each time. There are also similar commands you can use for other distros with different package managers.

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.

Use Tab Autocomplete In The Linux Terminal

Today’s article isn’t all that complex or anything, we’ll just cover how to use tab autocomplete in the Linux terminal. It’s a pretty handy tool to have in your Linux toolbox. It’s especially handy if you spend a lot of time in the terminal.

It seems to me that tab autocomplete is easier to do than it is to explain. It’s a great concept. I asked ChatGPT to explain it on my behalf and it did a fairly good job. It’s the middle of the night and I almost forgot to do an article. I got distracted, ended up elsewhere in the house, and fell asleep.

Fortunately, I already had the headline written. (Coming up with ideas is often more time-consuming than writing some articles.) That was a good thing. Otherwise, I’d have gone back to sleep and just written this tomorrow.

Anyhow, tab autocomplete is a tool that WILL save you some time. If you were local to me, it’d take like 2 minutes to show you how autocomplete works. It’s gonna take a bit longer to explain it with text!

I suppose that’s an adequate intro. Let’s see how AI does at explaining tab autocomplete and then try to make it more clear below that:

Use Tab Autocomplete In The Linux Terminal:

Linux terminal tab autocomplete is a feature that allows users to quickly and efficiently navigate through the file system and execute commands without typing out the entire file or command name. It works by automatically completing a partially typed file or command name when the user presses the “Tab” key.

To use tab autocomplete, the user needs to start typing the file or command name in the terminal window and then press the “Tab” key. If there is only one file or command that matches the typed characters, the system will automatically complete the name. If there are multiple matches, the system will display a list of possible options. The user can then continue typing until the desired file or command is highlighted and press “Tab” again to complete the name.

Tab autocomplete can be used for a variety of tasks, such as navigating the file system, running programs, and passing arguments to commands. For example, if the user wants to navigate to a directory called “Documents” in their home directory, they can type “cd Doc” and press “Tab.” The system will automatically complete the name to “cd Documents/”. This can save the user time and effort compared to typing out the full path.

Tab autocomplete also supports wildcards, which can be used to match multiple files or commands with similar names. For example, if the user types “ls *.txt” and presses “Tab,” the system will show a list of all the files in the current directory that end in “.txt”.

In summary, Linux terminal tab autocomplete is a powerful feature that allows users to quickly and efficiently navigate the file system and execute commands without typing out the entire name. It saves time and effort and can be used for a wide range of tasks.

Additional Tab Autocomplete Stuff:

So, to put that information to use, we can open a terminal. You can do so now just by pressing CTRL + ALT + T.

With your terminal now open, try the following command:

Now, press the TAB key on your keyboard (you may need to press the tab key twice). You’ll see something like this:

use tab autocomplete in the Linux terminal
You can probably figure it out from here. Once you understand it, you’ll appreciate it.

As you can see, it was not able to autocomplete because there were two available choices. If there are no choices it will show nothing. In this case, if you want to change to the Downloads directory, you’d enter the following:

Press the TAB key (probably twice), of course. For most of you, that’ll be enough. If it’s not, you should be able to figure out the minimum number of characters needed for autocomplete to work.

This also works on commands, but you need to have narrowed it down or it needs to not start with the more common letters. How to explain it?

If you type ‘l’ and hit tab, nothing will autocomplete.

If you type ‘ali’ and hit tab, it will spot autocomplete to ‘alias’. Additionally, it works for your installed applications. If you just enter ‘l’ and press the tab key (twice, if once doesn’t work) it will offer to display a bunch of commands starting with the letter ‘l’. For many of you, you should be able to just type ‘pav’ and then press the tab key to have it autocomplete to ‘pavucontrol’. That should make it reasonably clear.

Closure:

See? It’s not hard to do. It’s easier to do than it is to explain. I’ve never really needed to properly explain tab autocomplete in text format before. It’s much easier just to physically show folks than it is to explain it in text. Hmm… Now I can go back to bed. Dunno if I’ll sleep again, but I might as well try.

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.

Let’s Make An Animated GIF (With ImageMagick)

Today’s article is just for fun, where we learn how to make an animated gif in the terminal – with ImageMagick. It’s just for fun and not something you’ll likely need unless you’re some sort of content creator. (We don’t know any of those, do we?) Anyhow, let’s go ahead and make an animated .gif in the terminal.

Today, we’ll be using ‘ImageMagick’. As far as I know, imagemagick has one of the longest and most complicated man pages. It’s huge and a capable tool in the right hands. ImageMagick has all sorts of capabilities but a new user isn’t likely to use them because of the complexity involved.

And, ImageMagick is complex… In fact, it defines itself as:

ImageMagick – is a free software suite for the creation, modification and display of bitmap images.

That’s an accurate description, I think… Except, well, it does a whole lot more than that. We’ll be using the .gif format, while the man page description only mentions bitmap. So, there’s a lot to the application.

Thus, without further ado, we make an animated gif in the terminal…

How To Make An Animated GIF:

The ImageMagick application is terminal-based. So, you’re going to need an open terminal. If you want, you can just press CTRL + ALT + T and your default terminal should open.

If you don’t have ImageMagick installed, you’ll need to install it. If you’re using a mainstream distro, it’s possibly installed already. Otherwise, it’ll certainly be in your default repositories as it’s a pretty major tool. For example, an apt user would just use a command like this (adjust for your package manager):

With your terminal now open and imagemagick properly installed, let’s just see how long that man page is:

See? I wasn’t kidding!

Now, here’s what you need to make an animated gif:

  1. A dedicated folder, perhaps in your ~/Pictures directory.
  2. A few images of the same format, we’ll use .jpg in our example.
  3. A terminal opened in the above-mentioned dedicated folder.

The first thing to learn is that this command is going to take those images and turn them into an animated file with the .gif extension. It is going to organize them alphanumerically. So, you should rename the  .jpg files in the order you wish to see them (assuming the order matters to you).

All set? Have you done all those things? Are you 100% prepared? Good!

The command we’re looking for would be:

Alright, so the ‘delay 100’ is how long each image will be shown – in hundredths of a second. The ‘-loop 0’ tells it to loop infinitely, or you can pick your own number of times. The ‘*.jpg’ means use all the .jpg files in that directory. The ‘file_name’ is the name of the file you want to have as your output.

See? Pretty simple. An example command might be something like:

Let the command run, and it is a pretty speedy process unless you have a whole lot of images, and you’ll get an animated gif as a result. As these tend to have smaller file sizes, it’s sometimes a better option than sharing a larger video file. It depends on your circumstances, I suppose.

NOTE: This article has been edited to correct the time delay, the delay between changing images. Thanks @wizardfromoz!

Closure:

There you have it. You have an article that tells you how to make an animated gif with ImageMagick. The ImageMagick application has a ton of options, making it daunting for a new Linux user. So, this is just a tiny bite. This is just one of many ways to use ImageMagick. Instead of learning the whole application at once, you can do so in chunks – learning only what you need.

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: Show File Sizes When Listing Files In A Directory

Today we’re going to have an easy article that shows you how to show file sizes when listing files in a directory. It’s a simple set of commands and easy enough for a newbie to learn. Though the title is unwieldy, read on to learn how to show file sizes when listing files in a directory…

We’ll be using the ‘ls’ command for this exercise. Like normal, I’ll go ahead and suggest you read this page about why you shouldn’t parse the output from the ‘ls’ command. There are better ways and that link will explain it, and what you should consider, far better than I can.

Anyhow, the ‘ls’ command defines itself as:

ls – list directory contents

Of course, regular readers will recognize the ls command as we’ve used it numerous times before. Even though you shouldn’t parse the output from the command doesn’t mean it’s not still useful for a variety of other tasks.

Today, we’ll be exploring one of those tasks. We’re going to show you how to show file sizes when listing files in a directory – specifically with the ls command. Don’t worry, you won’t need to install anything. If you’re using any desktop Linux distro, the ls command is certainly available to you by default.

For the record, you should probably view the ls man page (run man ls in the terminal) to learn more about the command. It’s still a useful command – and I do sometimes parse the output from the command, but only when nobody is looking and when the output isn’t all that vital. I use grep with the ls command almost every day! Shh!!!

Show File Sizes When Listing Files In A Directory:

(That’s an unwieldy title!)

Anyhow, it’s the ls command. That’s a terminal-based command. So, of course, you’re going to need an open terminal (like so many of these articles). Press CTRL + ALT + T and your default terminal should open. Tada!

With your terminal now open, we can just use your home folder. To run the basic ls command, it’s just that:

Now, to show file sizes when listing files in a directory, you’d start with the -s flag:

You may find the output from that command is relatively useless without doing a bit of math to go along with it. Fortunately, you can tell the command to show the file size in a ‘human-readable format’. To do that, you’d run this command with the -h flag:

Now, if you wanted to show all the files, including the hidden files in that directory, you’d just add the -a flag. The command would look like this:

And if I was a Linux newbie, that’s the command I’d commit to memory. It doesn’t make a mess. The output is still plenty clear. It’s easy to understand. It’s easy to remember and turn into a habit. This way, when you ran the ls command, you just default to using -ash flags.

If you don’t want columns (and some do not), and you want more information such as file permissions or ownership values, you can just add an -lflag to the above. That’d look like:

So, it’s up to you…

You can remember ‘ash’ or you can remember ‘lash’. You can also not remember either and ignore the flags completely, but I find developing a habit is a good way to remember things. It’s your device, you do what you want!

Closure:

There you have it! You have another article. This one was simple enough and I hope you found it useful. If you’re new and running the ls command is new to you, it’s worth learning some additional flags and gathering more information at a glance. That’s why there’s this relatively simple article that shows you how to show file sizes when listing files in a directory.

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.

Let’s Find A Site’s MX Records

Today’s article is going to be rather specific and brief, as we learn how to find a site’s MX records. This isn’t something everyone is going to need to know, but it’s useful for debugging an email issue when you’re hosting websites. So, some folks are going to find it useful – and will then know how to find a site’s MX records. Read on!

I suppose most of my readers will not know what an MX record is…

In short, an MX (Mail Exchange) record is another DNS (Domain Name System) record. In this case, it is used to route emails to the correct server (via the IP address, basically). From there, your server will route the emails to individual email inboxes.

Basically, you want to know this information when things go pear-shaped with your emails or maybe when you’re using a 3rd party email service provider. There are reasons why people will want this information, they will want to find a site’s MX records.

Additionally, I figured I’d do this article now while ‘dig’ is still fresh in our memory. After all, I’ve used dig in the previous two articles and this is the final dig-related topic that I can think of. Here are the previous two articles, if you’re not reading these articles in order and are unfamiliar with the dig command:

How To: Find A Website’s IP Address
How To: Find A Site’s Nameservers

So, with all that in mind, let’s learn how to find a site’s MX records!

How To Find A Site’s MX Records:

Yes, dig is run in the terminal. Yes, you’ll need an open terminal to follow along. 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, the syntax for this specific dig command is:

For example, you’d find this site’s MX records with:

If you want, as the other dig commands used recently, you can use the +short flag with this, like so:

The output should look like this:

using the dig command to find a site's MX records
There, you can see this site’s MX records. This is public information. So, gawk away!

You can have more than one MX record, should you want failover but the mail protocol already includes some efforts to resend mail when there’s an outage. That’s irrelevant here, but information that I might as well share.

Also, like the other dig commands covered, you can put the flags at the end, like so:

So, that’s an option. I’m not sure why it’s an option. If anyone has a clue as to why it’s an option, do feel free to share. Heck, even if it’s a wild guess, I’ll take it. But, if you want more information about the dig command, run man dig in your terminal.

Closure:

There you have it, it’s another article. I think this is the last dig article, but who knows? This time around, we’ve learned how to find a domain’s MX records. For those that need to know, this will be handy.

For everyone else, you’ll likely forget this by tomorrow – and that’s okay. You don’t have to carry all the tools in your toolbox. If you tried, you’d need a very big toolbox and it’d be hard to carry 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.

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