Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Aug 8, 2013, 06:27 AM   #1
.eric
Banned
 
Join Date: Jul 2013
Best guides for Unix/Terminal?

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.

Thanks!
.eric is offline   0 Reply With Quote
Old Aug 8, 2013, 05:24 PM   #2
mfram
macrumors 6502a
 
Join Date: Jan 2010
Location: 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.
mfram is offline   0 Reply With Quote
Old Aug 8, 2013, 06:16 PM   #3
subsonix
macrumors 68030
 
Join Date: Feb 2008
You can get this PDF as a start.

https://developer.apple.com/library/...roduction.html

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


Quote:
Originally Posted by mfram View Post
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.
There's no need to get a Linux box as OS X is a compliant UNIX system.
subsonix is online now   1 Reply With Quote
Old Aug 8, 2013, 09:15 PM   #4
mslide
macrumors 6502a
 
Join Date: Sep 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.
mslide is offline   0 Reply With Quote
Old Aug 8, 2013, 11:36 PM   #5
ChrisA
macrumors G4
 
Join Date: Jan 2006
Location: Redondo Beach, California
Quote:
Originally Posted by .eric View Post
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.

Thanks!

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.
ChrisA is offline   0 Reply With Quote
Old Aug 9, 2013, 07:41 AM   #6
robvas
macrumors 68000
 
Join Date: Mar 2009
Location: USA
There are a lot of free UNIX books out there:

http://handbook5.com/u/unix-shell-pdf.pdf

There's a few things you want to learn -

How the shell (bash) works. Scripts etc
How the individual commands work and their options
robvas is offline   0 Reply With Quote
Old Aug 9, 2013, 02:51 PM   #7
macman7002
macrumors regular
 
Join Date: Apr 2008
There is a great video course on Lynda.com on using the Terminal. I'd also suggest checking out this online book "The Command Line Crash Course." You can find it here: http://cli.learncodethehardway.org/book/
__________________
macman7002 is offline   0 Reply With Quote
Old Aug 9, 2013, 04:02 PM   #8
.eric
Thread Starter
Banned
 
Join Date: Jul 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.
.eric is offline   0 Reply With Quote
Old Aug 10, 2013, 11:05 PM   #9
apmwnq
macrumors newbie
 
Join Date: Jun 2011
Location: 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 .
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 )
the solution is a third party project called "macports" OS X is not half the *nix its claimed to be without macports IMHO
apmwnq is offline   0 Reply With Quote
Old Aug 10, 2013, 11:21 PM   #10
apmwnq
macrumors newbie
 
Join Date: Jun 2011
Location: loops and branches of reality
oh i am sorry i forgot to address your orignal question OP
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 .
apmwnq is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
When will Mac Guides Return? Huntn Mac Guides 41 Aug 14, 2014 07:25 AM
The MR Guides are not accessible anymore simsaladimbamba Site and Forum Feedback 6 Feb 4, 2013 10:00 AM
Revive the guides section rabidz7 Site and Forum Feedback 1 Dec 27, 2012 11:01 AM
Terminal unix command questions savoym OS X 10.8 Mountain Lion 3 Sep 17, 2012 12:59 PM

Forum Jump

All times are GMT -5. The time now is 03:26 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC