Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

The question is in the title: How can I tell whether my system is Unix or Linux?

I am using a Macbook Pro of 2010 vintage.

share|improve this question
7  
How much did you pay for it? –  mikeserv yesterday
2  
There are (at least) four different definitions of the term "Unix": 1) the series of operating system(s) by Bell Labs, 2) the family of operating systems derived from the source code of 1), 3) any operating system that has passed certification by The Open Group (or 3a) any operating system that would pass certification by The Open Group but can't afford the certification fee), 4) any operating system that looks and feels like "Unix". For example, with the exception of specialized distributions like Android, most Linux distributions fall under 4), some under 3a), and a few under 3). –  Jörg W Mittag 18 hours ago
1  
OTOH, even though OSX falls under 2) and 3), I would argue that it doesn't fall under 4). Windows NT, at least in some versions, satisfies 3), but definitely not 4). –  Jörg W Mittag 17 hours ago

3 Answers 3

POSIX defines uname ("Unix name") to provide information about the operating system and hardware platform; running uname gives the name of the implementation of the operating system (or according to the coreutils documentation, the kernel). You can do this interactively in a terminal, or use the output in a script.

On Linux systems, uname will print Linux.

On Mac OS X systems, uname will print Darwin. (Strictly speaking, any operating system with a Darwin kernel will produce this, but you're very unlikely to encounter anything other than Mac OS X in this case.)

This will allow you to determine what any Mac is running.

uname -a will print all the available information as determined by uname, but it's harder to parse.

share|improve this answer
1  
Or just uname alone. uname is for Unix name. –  Stéphane Chazelas yesterday
1  
Indeed, "If no options are specified, the uname utility shall write the operating system name, as if the -s option had been specified." –  Stephen Kitt yesterday
1  
Yes, initially uname didn't take any option. case `uname` in... is a common idiom. –  Stéphane Chazelas yesterday
    
The problem is, uname does not prove it is running Unix. It only gives a name of the OS which might not be a Unix system. Linux, for example, is not Unix. –  Rob 13 hours ago

Unless you installed something else, Macs don't run Linux. Macbooks do run Apple's operating system called OSX which is certified Unix and, therefore, is the answer to your question.

share|improve this answer
    
Of course, some versions of Linux are also certified Unix, so the question then becomes, is it running Linux or Unix? –  Jörg W Mittag 18 hours ago
    
@JörgWMittag I see that the only version of Linux that is certified as Unix is an LDAP server running SUSE from IBM, but no others are or ever have been or probably ever will. my answer remains the same, though. If he didn't install Linux on a Mac then he's running OSX which is Unix. –  Rob 13 hours ago

The answer is:

uname -a

Or:

cat /proc/version
share|improve this answer
    
Open a terminal window and type 'uname -a' then return. –  Baazigar yesterday
1  
What can I deduce about the OS if cat /proc/version produce the error message cat: /proc/version: No such file or directory? –  kasperd 17 hours ago

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.