How To: Show User Information In The Linux Terminal

There comes a time in many Linux journeys when you want to know how to show user information in the Linux terminal. Well, if you’ve been waiting for such an article, this article is for you. After all, knowing about the various users might be important information for you.

You may not realize this, but your Linux system has all sorts of users. They belong to varied groups, sometimes more than one group at a time. Unless you’re already familiar with this subject, you probably have more users than you realize. 

That’s perfectly okay. It’s entirely normal to have different users. Linux is a user-oriented operating system. Users have varied permissions and can perform different tasks based on those permissions. 

This actually shouldn’t be a complicated article. It’s just a couple of commands, though the command may not be well-known among the newer Linux users. New users should familiarize themselves with the concepts of a multi-user system and with groups.

Anyhow, you shouldn’t need to install anything. The tools we’ll be using should be installed by default. You will need an open terminal. So, you have been warned. After all, it was right there in the title!

lslogins:

The tool we’ll expose you to today is ‘lslogins‘, which should be installed by default. You can verify that lslogins is installed with this command:

And, if you check the man page (with man lslogins) you’ll see this:

lslogins – display information about known users in the system

So, sure enough, that looks like it’s the correct tool for the job. Our goal is to show user information in the Linux terminal. This looks like a good way to go about it.

Show User Information In The Linux Terminal:

Yes, we’re doing this in the terminal. You can frequently open your terminal by pressing CTRL + ALT + T. Otherwise, you’ll find a terminal emulator somewhere within your application menu. It’s likely to be in the admin section of said menu.

With your terminal open, you can start with the basics. That is, we’re going to show all the known users with the lslogins command. That syntax is so simple.

You’ve got a lot of users. You may not know it yet, but you do. Here’s an example output from my system:

Now, that’s all well and good.

But…

Let’s say you only want to show user information about one single user. That’s fine and you can do that in a variety of ways. You can also do it just as easily with the lslogins command, simply by using the -u flag. 

The syntax is as follows:

An example output might look like this:

And there’s the information about the root user. You can try with your username and get information about things like the groups you belong to and more. Go ahead and give it a shot, you won’t break anything. I promise you won’t break anything with this command!

Closure:

You never know when you’re going to want to show user information in the terminal. It is useful information, especially when debugging things like permission errors. You may find you need to add yourself to a group or things like that. So, store this command away in your mental bank and save it for when you need this information.

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.

Find Out If A Package Is Installed In Debian

Today we’ll have a quick and easy article where we find out if a package is installed in Debian. There are times when you’re unsure of which packages are already installed. Today’s article looks to help with that, letting you know how to find out if a package is already installed.

Depending on where you live, yesterday was a holiday. A nice and easy article seems like a good idea. It’s actually a holiday as I write this, but that’s okay. I’d probably have written it ahead of time but Mother Nature was having her way with me and my neighbors. So, this is being written on Christmas Day. That’s another good reason to keep this short.

If you’re unaware, Debian is a Linux distro. Debian is one of the elders among distros, having just turned 30 not long before writing this article. It’s a very popular distro that has stood the test of time.

Debian also has a whole lot of derivatives. Then, there are derivatives of Debian derivatives. For example, there’s Ubuntu (and all the flavors) which has many derivatives, such as Linux Mint. While less common, there are probably derivatives of derivatives. By now someone has probably at least made a derivative of Linux Mint! (I did not look.)

That means that today’s article will apply to almost all of them. There’s bound to be an outlier, but anything still using apt or dpkg is good to go and will be able to use the information in this article. You won’t need to install anything, but you will need an open terminal.

Find Out If A Package Is Installed In Debian

Today’s article will involve the terminal. You can easily use a GUI for this. Just open your software manager to search for the package name. In this case, we’ll use a terminal and you can usually open your terminal by pressing CTRL + ALT + T.

You won’t need to install anything to determine if a package is installed in Debian. Everything you need, all the tools you’ll need, should be preinstalled. The tools you’ll be using:

dpkg:

You can use dpkg as one tool for this job. Given my preferences, this is the tool I’ll use for this job, simply because I like the output better. If you check the man page, you’ll see dpkg is described like so:

dpkg – package manager for Debian

That’s a pretty good-sounding description for the task. After all, we want to find out if a package is installed in Debian.

The syntax to do this with dpkg is quite simple:

For example (in Mint):

As you can see, Firefox is indeed installed. You should also remember that this operation is case-sensitive. This generally means you want lowercase letters.

apt:

You can also use apt to find out if a package is installed in Debian. If you don’t already know, apt is one of the tools you can use to manage packages in Debian. Think of apt (and apt-get, the stable cousin) as a front-end for Debian’s dpkg. The man page isn’t all that descriptive at first:

apt – command-line interface

But, if you look a little further, you’ll see:

apt provides a high-level commandline interface for the package management system.

So, apt is another fine tool to use for finding out if a package is installed in Debian. It too has a rather simple syntax and it looks like this:

For example (in Mint):

In this case, you can safely ignore the warning. Again, this is case-sensitive and you’ll almost certainly want lowercase letters in your command.

Closure:

See? A nice and easy article for you. It’s not all that difficult to find out if a package is installed in Debian. This is something you can do quite quickly with an open terminal emulator. It’s something easy enough to remember, as well.

Today’s article was nothing too taxing and is something that can come in handy because, if you’re like me, you can’t possibly remember all the packages you’ve installed. Then, when you do install packages, you’re often installing dependencies.

Keeping track of all of those packages manually would be a tedious process! Just a little bit of terminal knowledge makes quick work of this and the commands are easy enough to memorize. Try them a few times and you might just remember them by rote.

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.

Revisiting Christmas In The Terminal

Well, it’s the day before Christmas and a Linux Christmas can mean having Christmas in the terminal. If you do not celebrate the holiday, that’s fine. You can skip this article and move along. If you do celebrate this holiday, you might as well have a Merry Linux Christmas!

Last year, we had Christmas in the terminal. This year, we’ll be doing the same thing – but not in the same way. If you want an easier and quicker way to have Christmas in the terminal, you should follow along with the first article. This one is quite a bit more involved.

Let’s Have Christmas In The Terminal

That one is nice and easy! I’m also writing this article quite a ways ahead of time. I’ll schedule it for the nearest possible day. Due to my publication schedule, this won’t be published on the holiday itself.

NOTE: I did this on Linux Mint 21.2, Cinnamon Edition. That just happened to be the computer I was using. You may not need all of these steps if you’re using a different distro. You may already have things like Go and Git available.

We’ll be playing with all sorts of silliness and doing things we’d not normally do on this site. I’ll give clear directions, as much as I can. I won’t be diving into details like I have lately. This is a holiday article and ain’t nobody got time for that!

Linux Christmas In The Terminal:

You will need an open terminal. As I did this in Mint, I was able to open a terminal by just pressing CTRL + ALT + T which is something you too should be able to do in most distros.

With your terminal now open, let’s get into a good directory:

Next, we’ll install Git.

Then we’ll download some files with Git.

Now we move to the new directory:

This is in the language known as Go, so let’s get set up to compile that.

Now we’ll do some compilation magic.

Let that finish and run this command:

With any luck, you’ll see something like this in your terminal:

Tada! It even has blinking lights! That’s a rather festive terminal!

You can exit the program by pressing CTRL + C.

Of course, you can move the ctree file anywhere you want. If you want to just run it from the terminal, copy it to /usr/local/bin and you can do that. This being a temporary thing, I saw no reason to move the binary to a special location. If you do want to just run it anywhere in the terminal, you’d use this command:

Enjoy your holiday celebrations!

Closure:

I don’t think this can become a tradition or anything like that. There are only so many Christmas-themed things out there that you can do in the terminal. I didn’t create this and I have no idea what I’ll be able to find for the next Christmas. We’ll have to wait and see what next year brings. Until then, keep being you!

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.