PDA

View Full Version : Best guides for Unix/Terminal?




.eric
Aug 8, 2013, 06:27 AM
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!



mfram
Aug 8, 2013, 05:24 PM
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.

subsonix
Aug 8, 2013, 06:16 PM
You can get this PDF as a start.

https://developer.apple.com/library/mac/documentation/OpenSource/Conceptual/ShellScripting/Introduction/Introduction.html

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


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.

mslide
Aug 8, 2013, 09:15 PM
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.

ChrisA
Aug 8, 2013, 11:36 PM
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.

robvas
Aug 9, 2013, 07:41 AM
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

macman7002
Aug 9, 2013, 02:51 PM
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/

.eric
Aug 9, 2013, 04:02 PM
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

apmwnq
Aug 10, 2013, 11:05 PM
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 :)

apmwnq
Aug 10, 2013, 11:21 PM
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: