Command to tell what Linux operating system

I needed a command to tell me what Linux operating system I was working with. Servers are occasionally built for me and I need to know what operating system I am using. I used to type uname -a but that only gives me some basic information (Linux hostname kernel version etc). What I needed today was a way to find out quickly what flavour of Linux distribution I was knee deep coding in.

I used tail /etc/*release* which returned the following information

Red Hat Enterprise Linux Server release 5.7 (Tikanga)

In this case what I essentially did was tail a file called redhat-release but I was not prepared to “Display all 170 possibilities? (y or n)” so I used a wildcard at each end of the file name *release*.

Please let me know if you have a better way of doing this which is able to be used on all Linux/Unix systems.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s