Today we’ll be learning about a basic Linux command that’s known as ‘uname’ and it will be available in every Linux you are likely to touch. The uname command is one way to show some important system information in the Linux terminal.
You won’t even need to install anything. That’ll keep things easy and short!
The uname command stands for ‘Unix Name’ and is a part of ‘coreutils’, meaning it’s a default application included with Linux. If you’re using Linux, you almost certainly have the uname command available to you. I suppose someone might have stripped it out of an embedded system somewhere, but even that’s unlikely.
The uname command is used for displaying system information. It’s a bit limited in scope, but it still has useful information and the command is one you’ll see referenced often enough.
1 | uname --v |
As I said, it’s a core utility in Linux. That means that uname is included with a bunch of other core utilities. If you want, you can easily check the man page with this command:
1 | man uname |
If you do that, you’ll see this:
uname – print system information
So, this command can and will show system information. That’d be what I told you it did in the first paragraph. I do my best to not steer you wrong and that’s exactly what we’ll do with this article.
So, let’s learn how to use the uname command in Linux:
Use The uname Command:
As mentioned above, you use the uname command in the terminal. That means you’ll need an open terminal. You can usually press
With your terminal open, you can just run uname in the terminal and it will tell you what sort of system you’re running. Try it…
1 | uname |
It’ll happily spit out that you’re using Linux – if you are indeed using Linux.
It’ll also happily tell you the kernel name with the -s flag.
1 | uname -s |
It should again spit out “Linux”, as that’s the kernel’s name.
If you want to know the kernel release information, use the -r flag.
1 | uname -r |
Do you want to know if it’s 32 or 64-bit (or if it’s ARM? Try this command:
1 | uname -i |
If you want to know the specific kernel version:
1 | uname -v |
Then, you can learn the machine’s name with the -m flag.
1 | uname -m |
You may just remember ‘mrs’ as that’s commonly asked for in some support circles (and worth remembering):
1 | uname -mrs |
There’s more to it but all you need to know is how to get all the information at once. That’s all you need to know. That’s just using the -a flag, like so:
1 | uname -a |
You’ll get an output similar to this:
1 2 | $ uname -a Linux kgiii-msi 5.15.0-107-generic #117-Ubuntu SMP Fri Apr 26 12:26:49 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux |
Which is quite a bit of system information and makes the uname command a useful command in and of itself. It’s an easy-to-remember command and one available in any Linux you’re likely to touch.
Closure:
I was a bit surprised that I’d never covered the uname command before. It’s a pretty basic command and so I’m surprised that I overlooked it. No worries. I’ve covered it now. There’s more to it but you’ll be fine with just the flags I mentioned.
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.
Last Updated on May 29, 2024 by KGIII