LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   which command can show the result of the linux you are using? (https://www.linuxquestions.org/questions/linux-newbie-8/which-command-can-show-the-result-of-the-linux-you-are-using-4175436172/)

Mike.JIn@Shanghai 11-07-2012 07:17 PM

which command can show the result of the linux you are using?
 
Hi, every one.
I have a question.

which command can show the distribution of the linux you are using?

Since there are so many distributions of linux in using in the world. For example rhel, suse linux,
Ubuntu and so on.

I have a method
click ctrl+alt+F2.
the interface will show the distribution you are using currently.

Could you tell me which command typed in the terminal
and the result will appear immediately.

yancek 11-07-2012 07:32 PM

One or both of the commands below should work.

cat /etc/release
cat /etc/issue

Mike.JIn@Shanghai 11-07-2012 07:44 PM

Thank you

cat /etc/release does not work.
but 'cat /etc/issue' works successfuly

TobiSGD 11-07-2012 07:51 PM

Many distros (even Slackware) nowadays have the file /etc/os-release for this purpose, with information about distro, version and even addresses for support.

towheedm 11-07-2012 08:46 PM

If you have the lsb-release package installed, it can also provide that info:
Code:

lsb_release -a
No LSB modules are available.
Distributor ID:        Debian
Description:        Debian GNU/Linux 6.0.6 (squeeze)
Release:        6.0.6
Codename:        squeeze


shivaa 11-07-2012 09:13 PM

You can use "uname" command with -a option, it stands for "Unix name" & I hope it will work on all Unix based distro available.
Code:

example% uname -a

catkin 11-07-2012 10:20 PM

Quote:

Originally Posted by shivaa (Post 4824659)
You can use "uname" command with -a option, it stands for "Unix name" & I hope it will work on all Unix based distro available.
Code:

example% uname -a

At least on SLackware 13.37 uname -a does not show the distro:
Code:

c@CW9:~$ uname -a
Linux CW9 2.6.37.6-c1 #1 Wed Jun 20 10:48:32 BST 2012 i686 Intel(R) Atom(TM) CPU N450  @ 1.66GHz GenuineIntel GNU/Linux

There is no single technique that works on all distros. The rkhunter shellscript function rkh_dat_get_os_info is a good example of what is required. Available via http://rkhunter.cvs.sourceforge.net/

chrism01 11-08-2012 12:57 AM

I use the wildcard approach
Code:

cat /etc/*release*
to get the distro+version.

As above, uname -a gives the kernel version info


All times are GMT -5. The time now is 05:27 AM.