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:

cat /etc/redhat-release

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

cat /etc/*release

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

uname -mrs

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 ;-)





Jay is the CEO and founder of WP Hosting, a boutique style managed WordPress hosting and support service. He has been working with Plesk since version 9 and is a qualified Parallels Automation Professional. In his spare time he likes to develop iOS apps and WordPress plugins, or drawing on tablet devices. He blogs about his coding journey at http://wpguru.co.uk and http://pinkstone.co.uk.