how to tell which OS via command line | Unix Linux Forums | UNIX for Dummies Questions & Answers

  Go Back    


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

how to tell which OS via command line

UNIX for Dummies Questions & Answers


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 05-15-2007
hankooknara hankooknara is offline
Registered User
 
Join Date: Dec 2006
Last Activity: 30 September 2007, 3:54 PM EDT
Posts: 80
Thanks: 0
Thanked 0 Times in 0 Posts
how to tell which OS via command line

What is the command line to find out what OS you are running on linux?

I initially thought uname -a would do it, but it only lists kernel version.. can someone tell me?

thanks in advance.
Sponsored Links
    #2  
Old 05-15-2007
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon (Administrator Emeritus)
 
Join Date: Aug 2001
Last Activity: 22 April 2014, 9:51 PM EDT
Location: Ashburn, Virginia
Posts: 9,836
Thanks: 42
Thanked 382 Times in 227 Posts
"uname -a" is the right command, but it is not too helpful in determining which Linux Distro you have. It should at least inform you that you are running Linux and not HP-UX, FreeBSD, SunOS, etc.

As for which distro, Linux does not yet have a great way to do this, but it is moving towards a way. See: http://linuxmafia.com/faq/Admin/release-files.html for a good write-up on the current state of affairs.
Sponsored Links
    #3  
Old 05-15-2007
zazzybob's Avatar
zazzybob zazzybob is offline Forum Advisor  
Registered Geek
 
Join Date: Dec 2003
Last Activity: 13 May 2013, 9:02 AM EDT
Location: Melbourne, Australia
Posts: 2,185
Thanks: 3
Thanked 24 Times in 23 Posts
Depends on Linux distribution.

Take a look under /etc for a file named *release*


Code:
ls /etc/*release*
cat /etc/*release*

Not all distributions provide this file.

Cheers
ZB
    #4  
Old 05-15-2007
porter porter is offline Forum Advisor  
Registered User
 
Join Date: Jan 2007
Last Activity: 8 January 2008, 6:50 PM EST
Posts: 2,965
Thanks: 0
Thanked 5 Times in 5 Posts
Quote:
Originally Posted by hankooknara
What is the command line to find out what OS you are running on linux?

Code:
echo linux

Sponsored Links
    #5  
Old 05-15-2007
adhirgarg adhirgarg is offline
Registered User
 
Join Date: Dec 2006
Last Activity: 9 June 2009, 4:19 AM EDT
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
uname -X

uname -X is one ofthe commands which gives all the operating system variables.

Regards
Adhir Garg
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
how to replace html line into a command line? nitrofurano Shell Programming and Scripting 2 04-22-2012 03:02 PM
Bash - Loading a command's output line by line into an array Azrael Shell Programming and Scripting 4 09-20-2011 04:42 AM
Need help in sed command [ printing a pattern + its line no or line no alone ] frozensmilz Shell Programming and Scripting 4 06-28-2009 10:38 AM
reading ps command's output line by line s. murat Shell Programming and Scripting 5 05-22-2008 04:23 AM



All times are GMT -4. The time now is 02:41 AM.