# Trying to learn UNIX!!! For Mac OS X!



## nietzsche2131 (May 14, 2005)

Well I'm trying to learn UNIX. But for the mac I heard that is different, i.e some of the commands are a tad different from linux/unix. I've looked at amazon for some book about this topic. The O'Reilly one, Unix for Mac OS X looks good. But, if somebody could a site to learn basic command line in mac os x that would be sweet thanks for your time.


----------



## Viro (May 14, 2005)

Mac OS X is uses the BSD tools. If you have a site on BSD Unix (FreeBSD, NetBSD, etc), it'll be more helpful than sites for Linux.


----------



## spb (May 14, 2005)

I'm coming to Mac from the GNU/Linux.  I like the Mac, but it is different from UNIX/Linux.  

It is more than just BSD vesus SysV, many of the commands are overridden by the Mac OS.  For example, the "hostname" command is used the change the name of the computer in GNU/Linux and UNIX.  In OSX, you can run hostname in terminal, but when you exit terminal it reverts back to what you have in the OSX preferences.  

I'm not saying that this is bad, but I would say that Mac is not UNIX.  

If you want to learn UNIX/Linux, I'd suggest that you get a cheap (used) PC and install one of the free OS's.  Slackware GNU/Linux and FreeBSD are both BSD based so that you can learn more about the basis that OSX is built on.


----------



## Andrew Adamson (May 14, 2005)

I did a quick search and found this site. Probably does the trick for what you want.

http://www.ss64.com/osx/

You can usually find what you are looking for by using the 'apropos' command. If you want to find the command that changes the group permissions on a file, for example, just type in 'apropos group' and see what comes back. Use 'man' to see the manual page on any command you are interested in learning more about.

Without a doubt, Darwin commands and Linux commands are different (Apple goes so far as to say 'Mac is NOT Unix'). But for the basic user, the similarities are much more numerous than the differences.


----------



## spb (May 15, 2005)

Andrew Adamson said:
			
		

> Without a doubt, Darwin commands and Linux commands are different (Apple goes so far as to say 'Mac is NOT Unix'). But for the basic user, the similarities are much more numerous than the differences.



Compared to MSWindows yes, OSX and UNIX are similar.  Comparing namebrand UNIX/Linux OS's and OSX, the slew of UNIX/Linux OS's have more in common with one another than with OSX.  OSX is built on UNIX, but it adds to it, which gives the OS a different feel.  

My recommendation to nietzsche2131 and others is that they learn UNIX from one of the free *NIX's and then apply the principles to OSX.  The analogy that comes to mind is someone wanting to learn about automobile mechanics.  You can learn by working with a vintage 1970's machine or a modern model.  They both work on the same principle, but there is so much electronic augmentation to the 2005 automobile compared to the older models that it might be better to see how things work first on the vintage machine and then see how they are augmented in the modern automobile.   

When I started using OSX this year, I read through, "Mac OSX Panther" and "OSX for UNIX Geeks."  Both are produced by O'Reily Publishing.  I can't say that I can recommend these for learning UNIX.  The book that I learned the most about using UNIX was, "Unix System V: A Practical Guide," by Mark Sobell.  Again there will be minor differences between the SysV UNIX and the BSD UNIX, but these are minor, and the hands on examples in Sobell's text are generic enough that they will work on both flavors of UNIX.  

sb


----------



## HomunQlus (May 17, 2005)

Well, the base of OS X is Darwin with the Mach Kernel, and as far I know that still is UNIX, it's not different at all. But: Yes, Apple changed some commands, but in its entirety I'd say it still is a UNIX.


----------



## Andrew Adamson (May 17, 2005)

Veeery interesting discussion on Slashdot a while back (in their discussion of the release of Tiger... two days after the fact). Here's a branch on that thread that has the interesting bit. There are aspects of this argument that fly well above my head, but it sounds like the author, AsSeenOnTV, speaks with some authority on the matter. Sounds a little like angels and pin heads...

Owing to the fact that OS X completely lacks /proc and /dev make me think that OS X is fundamentally different (er, different at a fundamental level), but I don't really know one way or the other. All I can say is that OpenBSD (the only BSD I've worked on) and Linux (RedHat and Slack) and OS X all have commands and command switches that are mutually exclusive. I spend most of my time in a shell (mostly in emacs), so personally I find it a little annoying.


----------



## RacerX (May 17, 2005)

spb said:
			
		

> but I would say that Mac is not UNIX.


Yeah, but you should remember that GNU/Linux is not UNIX.



Infact, GNU stands for *G*NU is *N*ot *U*NIX.

As for the heritage of Mac OS X, NEXTSTEP, OPENSTEP and Rhapsody are based on 4.3BSD. Rhapsody included parts from OpenBSD and NetBSD. Mac OS X's Darwin is based on 4.4BSD Lite with parts from FreeBSD (which is also based on 4.4BSD Lite).

Mac OS X is a _Unix_, but is not _UNIX ®_ (a licensed trademark of the Open Group).

Of my many Unix systems, only my SGIs and Suns qualify as UNIX.

Just FYI.


----------



## spb (May 17, 2005)

RacerX said:
			
		

> Infact, GNU stands for *G*NU is *N*ot *U*NIX.



Very true. :7)

Yes, strickly OSX is a Unix and is based upon a branch of BSD.  

I've come to OSX from GNU/Linux (Debian, Ubuntu, RedHat).  I've used a variety of other Unix platforms (DEC, IRIX, True64, AIX) and find that with a few exceptions they all have a similar feel and behavior.  

I found that my transition to OSX was not straight forward and hence I'm guessing that going from OSX to another Unix also is not necessarily simple.  For this reason I would argue that it is better to learn Unix from somewhere other than OSX.  There are Unix skills that can be learned on OSX such as scripting, but this can also be learned in MSWindows via emulators such as cygwin.

sb


----------



## lurk (May 17, 2005)

spb said:
			
		

> Very true. :7)
> I've come to OSX from GNU/Linux (Debian, Ubuntu, RedHat).  ...I found that my transition to OSX was not straight forward and hence I'm guessing that going from OSX to another Unix also is not necessarily simple.



That is where you are wrong, it is trivial compared tot he hassle of moving to Linux   As was already pointed out Linux is not Unix.  If you had come from FreeBSD you would not have noticed much at all.  This is the same old BSD Sys V thing that has been going on in the *nix world for ages, but they both count.


----------



## Andrew Adamson (May 17, 2005)

Just out of curiosity, did ANYBODY read the thread on Slashdot? Again, I am not going to take a hard stand on this one way or the other, but I do find the comments of 'AsSeenOnTV' a little more convincing. Perhaps it is just a question of marketing and strategy, but when you read the Apple site, they never say 'Unix', they say 'Unix environment' or 'Unix-based' or 'Unix-derived' or 'Unix foundation'. Once you notice that, it starts to become a little hard not to notice it being done everywhere on Apple. On the other hand, the fact that Tiger is _less_ like Unix (missing things like rc.d and cron) makes me think that at its foundation, Darwin really IS Unix (or at least, WAS Unix).


----------



## RacerX (May 17, 2005)

It is important to understand that UNIX is a licensed trademark... Windows NT could be made to qualify as UNIX... and it would never be a Unix (ancestral Unix).

Also, qualifying for the license needs to be redone with any major change to the operating system. This is one of the reasons why IRIX is now at 6.5.27... because they don't want to have to requalify. In fact they most likely couldn't qualify today as they were licensed as UNIX 95 and they would have to pass as UNIX 03 now.

There would be no advantage for Apple to qualify Mac OS X to use the trademark UNIX... and they would have had to requalify for 10.2, 10.3 and 10.4. That would have been a lot of work for almost no advantage at all.



			
				spb said:
			
		

> I've come to OSX from GNU/Linux (Debian, Ubuntu, RedHat). I've used a variety of other Unix platforms (DEC, IRIX, True64, AIX) and find that with a few exceptions they all have a similar feel and behavior.


They should, they are all based on System V or are System V look-a-likes.

My background is with NEXTSTEP/OPENSTEP/Rhapsody/Mac OS X (14 years), IRIX (11 years) and Solaris (6 years). And I have no problems moving between these.



> I found that my transition to OSX was not straight forward and hence I'm guessing that going from OSX to another Unix also is not necessarily simple. For this reason I would argue that it is better to learn Unix from somewhere other than OSX.


I don't think that an argument based on your short comings (not meant as inflamitory, based only on your own admission) makes that much sense here. Someone should learn Unix on the platform which they are going to use.

What you are suggesting is that this person learn something different so that Mac OS X will be foreign when he is finished. That is a pretty odd suggestion from my point of view.


----------



## wiz (May 17, 2005)

yea i agree, its just as easy to learn Darwin than it is to learn FreeBSD or Linux.


----------

