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.