LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 01-21-2010, 10:48 AM   #1
nasridine
Member
 
Registered: Jan 2010
Posts: 52

Rep: Reputation: 15
how to tell which OS with command line


Just want to know what OS is, Fedora/RH/...
Tried the following on a redhat machine:
uname -o : GNU/Linux
less /proc/version:
Linux version 2.6.18-164.el5 (mockbuild@x86-002.build.bos.redhat.com) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-46)) #1 SMP Tue Aug 18 15:51:54 EDT 2009

what is the right command to do it?
 
Old 01-21-2010, 11:17 AM   #2
rweaver
Senior Member
 
Registered: Dec 2008
Location: Louisville, OH
Distribution: Debian, CentOS, Slackware, RHEL, Gentoo
Posts: 1,833

Rep: Reputation: 167Reputation: 167
Usually the distributor of the particular revision includes a file to tell you what it is...

Code:
cat /etc/*{ersion,elease}
Most systems maintain some kind of identifier like that, sometimes the motd or uname -a will include telling information also.

Sometimes the kernel will tell you:

Code:
dmesg | head -10

Last edited by rweaver; 02-01-2010 at 04:28 PM. Reason: revised the cat line so it does all the release files mentioned in the script by catkin.
 
Old 01-21-2010, 11:30 AM   #3
nkd
Member
 
Registered: Oct 2006
Location: india
Distribution: fedora 8, ubuntu 10.10
Posts: 318

Rep: Reputation: 34
use uname -r , the output shall be
[user@localhost etc]# uname -r
2.6.27.5-117.fc10.i686


means it is a fedora 10 machine.

thanks
nishith
 
Old 01-21-2010, 12:12 PM   #4
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
There is no universal method to find the distro name. A script function in this LQ post encapsulates some of the methods.
 
Old 01-21-2010, 01:07 PM   #5
rweaver
Senior Member
 
Registered: Dec 2008
Location: Louisville, OH
Distribution: Debian, CentOS, Slackware, RHEL, Gentoo
Posts: 1,833

Rep: Reputation: 167Reputation: 167
Quote:
Originally Posted by nkd View Post
use uname -r , the output shall be
[user@localhost etc]# uname -r
2.6.27.5-117.fc10.i686


means it is a fedora 10 machine.

thanks
nishith
There are sometimes problems with that method determining between centos and redhat. Both report the same for kernel version, although it's good for sorting out fedora. Debian for instance doesn't report anything regarding itself with a uname -r (2.6.26-2-686) and an -a reports additional information you can sometimes sort through to tell the distribution.
 
Old 01-21-2010, 03:00 PM   #6
kyphi
LQ Newbie
 
Registered: Jun 2009
Location: Australia
Distribution: Ubuntu
Posts: 25

Rep: Reputation: 18
cat /etc/issue
 
Old 01-21-2010, 04:08 PM   #7
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by catkin View Post
this LQ post encapsulates some of the methods.
...or see rkh_dat_get_os_info() function in Rootkit Hunter. It's more elaborate and has been around for a while now.
 
Old 01-21-2010, 09:50 PM   #8
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 unSpawn View Post
...or see rkh_dat_get_os_info() function in Rootkit Hunter. It's more elaborate and has been around for a while now.
More fully featured and more mature sounds good Can you post a link to it?

Last edited by catkin; 01-21-2010 at 09:51 PM. Reason: In search of clarity
 
Old 01-23-2010, 11:43 AM   #9
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
See http://rkhunter.cvs.sourceforge.net/...er?view=markup around line 3550?
 
1 members found this post helpful.
Old 01-23-2010, 03:10 PM   #10
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 unSpawn View Post
Thanks
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
LXer: The Linux Command Shell For Beginners: Fear Not The Command Line! LXer Syndicated Linux News 0 12-22-2008 06:30 PM
My error in mkisofs command to make a command line iso mg92865 Linux - Newbie 1 06-20-2008 11:43 AM
xine command line? or some other command line only engine? lumix Linux - Software 2 08-10-2007 10:46 AM
Command to output file content line by line aznluvsmc Programming 2 09-12-2004 07:45 PM
51 characters only in the 1st Line of command line eggCover Linux - General 2 07-29-2004 01:28 PM

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

All times are GMT -5. The time now is 01:58 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