How to show your Linux Version

Sometimes you’re working on a system and you’re not entirely sure which Linux distribution it is. There are several ways to find out what you’re working with and I keep forgetting what they commands are to get there – so here’s a quick list for all of us.

Release and Distribution

Most systems (but not all) have a file called something-release in the /etc directory. On CentOS and Redhat this is /etc/redhat-release. Display the contents of that file and you’ll find out:

This is not going to work on an Ubuntu system for example where the file is called something different. The best approach hence is to call

which will give you the output no matter which distribution you’re on. You may also try

lsb_release -a

however this does not work on all systems. When it does it will typically show you a more detailed output.

Linux Kernel

If you want to dig even deeper and find out which Kernel you’re using, or if you’re working on a 32/64 bit system, try issuing

which will show you those. Try -a instead for a more detailed output.

Hubert is running CentOS 5.8 in 64bit. Looks like he needs an upgrade.

Hope this helps 😉

About Jay Versluis

Jay is a medical miracle known as Super Survivor. He runs several YouTube channels and websites, and he's also live on Twitch sometimes. To support him on his mission to make the world a better place, you can support him on Patreon or buy him a coffee.

Add your voice!