Best guides for Unix/Terminal?

Discussion in 'Mac Programming' started by .eric, Aug 8, 2013.

  1. macrumors member

    Jul 30, 2013
    Title says it all! Looking for some good guide(s) for using Unix/Terminal on OSX. I took a course on C++ which involved using Solaris and I thought it was pretty cool, and I'm interested in learning more about how Unix and OSX work.

  2. macrumors 6502a

    Jan 23, 2010
    San Diego, CA USA
    I'm guessing you probably won't find many books on Mac shell details exactly. However, you will find a lot more books on Linux and and Shell programming since it's a more popular platform right now.

    Put together a Linux box, get a book on Linux shell programming and start learning. The bash shell used in Linux is essentially the same bash shell used on the Mac.

    Some of the details and system level commands are a little different, but the concepts of how to program in bash, how to use pipes, and how to move around a Unix filesystem is going to be pretty much the same on Macs and Linux boxes.

    I can't personally recommend a book because I learned how to use the Unix shell environment many years ago in college. There it was on Sun, NeXT, and early Linux boxes.
  3. macrumors 68040

    Feb 2, 2008
    You can get this PDF as a start.

    An old but good book is: The UNIX Programming environment. You can find it at Amazon.

    There's no need to get a Linux box as OS X is a compliant UNIX system.
  4. macrumors 6502a

    Sep 17, 2007
    The best way to learn is to dive right in and start playing around. OSX is UNIX so you can open the Terminal app and start playing around. Start with simple things like moving around the filesystem, copying/moving files and what. Googling "unix tutorial" and the like will probably be enough to get you started. Maybe play around with bash scripting. Try out utilities like grep, sed, awk, find. If you're into programming then maybe gcc, gdb, make.

    The best way to get really good with UNIX is to move beyond your home directory. I learned by running my own servers. Things like setting up a web/ftp/mail/dns server and what not. Do it all on the command line. If you want to start doing this sort of thing, I'd definitely do it in a virtual machine so you don't run the risk of screwing up your OSX install. Download VirtualBox (free) and pick a *nix OS and go nuts. Linux is a popular choice. I'd personally go with FreeBSD since parts of OSX come from it (and I personally prefer it for servers). For example, lots of the user-land utilities are from FreeBSD (although they are similar on Linux). The FreeBSD handbook has a ton of info in it. Maybe try learning how to build and install a new kernel.

    When you're on the command line, one of your most important tools is "man". It's the help system for *nix systems. Type "man <name of command>" and you'll see the "man page" (hit 'q' to exit). You'll also need to use a text editor a lot. If you want to go hard core, then use vi which is my editor of choice. It's available on every *nix OS and also has a steep learning curve.
  5. macrumors G4

    Jan 5, 2006
    Redondo Beach, California

    The man pages are the best source of information. try the man page ffor the shell you like to use, either "man csh" or "man sh" and work from there.
  6. macrumors 68000

    Mar 29, 2009
    There are a lot of free UNIX books out there:

    There's a few things you want to learn -

    How the shell (bash) works. Scripts etc
    How the individual commands work and their options
  7. macrumors regular

    Apr 28, 2008
    There is a great video course on on using the Terminal. I'd also suggest checking out this online book "The Command Line Crash Course." You can find it here:
  8. thread starter macrumors member

    Jul 30, 2013
    Thanks for all your input. I ended up finding a copy of Learning Unix for OS X Mountain Lion by Dave Taylor. I'm going to start there, and keep this thread marked so I can check out some of the other things that have been suggested.

    Thanks so much again!

    Also, general discussion thread if you guys would like. :D
  9. macrumors newbie

    Jun 24, 2011
    loops and branches of reality
    i learned the cli way of doing things on a mac , so if i were to say my first *nix was OS X then i am not kidding you .:cool:
    the problem with OS X compared to Gnu/Linux is the lack of an official package manager and repositories that houses Free as in Freedom stuff that has the best following on any *nix ( tell you the truth i was pretty disappointed when i found out OS X doesn't have wget :confused:)
    the solution is a third party project called "macports" OS X is not half the *nix its claimed to be without macports IMHO :)
  10. macrumors newbie

    Jun 24, 2011
    loops and branches of reality
    oh i am sorry i forgot to address your orignal question OP :p
    well i recommend getting a hang of the internals of a *nix system first
    please note that my way of learning may not be the best or any good at all but its the one that worked for me .

    i switched to a Gnu/linux distro "Debian" for 3 years before returning to OS X
    the time i spent on debian taught me a lot , its basically the debian-reference
    package that has the best docs for your situation , apple's docs go straight into APIs and all the major stuff cause they are targeted at devs who switch platforms or port their programs to OS X among many others .

    so my recommendation is running debian in a VM and learning from there .:cool:

Share This Page