LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-07-2012, 07:17 PM   #1
Mike.JIn@Shanghai
LQ Newbie
 
Registered: May 2011
Location: Shanghai
Posts: 2

Rep: Reputation: Disabled
Lightbulb 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.

Last edited by Mike.JIn@Shanghai; 11-07-2012 at 07:18 PM.
 
Old 11-07-2012, 07:32 PM   #2
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,508

Rep: Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490
One or both of the commands below should work.

cat /etc/release
cat /etc/issue
 
1 members found this post helpful.
Old 11-07-2012, 07:44 PM   #3
Mike.JIn@Shanghai
LQ Newbie
 
Registered: May 2011
Location: Shanghai
Posts: 2

Original Poster
Rep: Reputation: Disabled
Thank you

cat /etc/release does not work.
but 'cat /etc/issue' works successfuly
 
Old 11-07-2012, 07:51 PM   #4
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
Many distros (even Slackware) nowadays have the file /etc/os-release for this purpose, with information about distro, version and even addresses for support.
 
Old 11-07-2012, 08:46 PM   #5
towheedm
Member
 
Registered: Sep 2011
Location: Trinidad & Tobago
Distribution: Debian Stretch
Posts: 612

Rep: Reputation: 125Reputation: 125
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
 
Old 11-07-2012, 09:13 PM   #6
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
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
 
Old 11-07-2012, 10:20 PM   #7
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Quote:
Originally Posted by shivaa View Post
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/
 
Old 11-08-2012, 12:57 AM   #8
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
I use the wildcard approach
Code:
cat /etc/*release*
to get the distro+version.

As above, uname -a gives the kernel version info
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Grep for the result of a command within the result of another command jasonws Programming 6 11-18-2010 02:39 PM
Show images from a database result. conesh Programming 2 06-25-2010 04:27 PM
show for-loop result in one zenity dialog Dr_Death_UAE Programming 3 11-01-2009 03:04 PM
top command result to a file in a readable format in linux rajeevp05 Linux - General 2 02-03-2009 09:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration