Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Learning terminal - suggested reference / community guide?

I'd like to learn how to transcend the limitations of my Mac's present functionality and my impression is that, ultimiately, the best way to do so is to learn to use the command line and write scripts from there.


Does anyone know of a great intro to the command line / online forum equivalent to the outstanding Tex stack exchange? I'd really like to enjoy the process insofar as possible, so a structured intro would be greatly appreciated!


Kind regards,



Rax Adaam

MacBook Air, Mac OS X (10.6.7), Mem: 2GB 1067 MHz DDR3 (sigh)

Posted on May 11, 2012 5:16 PM

Reply
10 replies

May 13, 2012 9:12 PM in response to Rasuul

Learning the command line teaches you Unix, it doesn't really teach you about Mac OS X.


There are other posts about learning the command line. You should even be able to see some on the right hand side of the web forum. And you can search for Terminal and most likely find similar posts. There have been pointers to online Mac OS X Terminal command tutorials.


Go to a bookstore and browse just about any book on Unix/Linux command lines stuff. Especially books on "Bash" (the default Mac OS X shell), and other books on Unix/Linux scripting. While not everything will be the same, 80% of what these books talk will apply to Mac OS X.


You can find useful posts at MacOSXHints.com which frequently has posts about doing things via the Unix side of Mac OS X.


Finally the Terminal is nothing, it is just a bit of software that displays the output from the shell, and programs run by the shell, and passing input from the keyboard to the shell and programs run by the shell. Besides that the Terminal doesn't really have any significant power.


Use the "man" command to find out information about various commands ("man man"). Use "apropos" to find possible commands that will do what you want ("man apropos").


Most of the commands that the bash shell will execute will be found in /bin, /usr/bin, /sbin, /usr/sbin, and /usr/X11/bin. If you have installed XCode developer tools, you will find more commands in /Developer/usr/bin, /Developer/usr/sbin, /Developer/Tools. Additional progarm may be found in other locations, as a command is just an executable program, or executable shell script, or a built-in command within the shell (bash).

May 14, 2012 6:33 AM in response to BobHarris

Thank BobHarris - I'm aware of some of those distinctions, although it is hugely helpful to have them summerised in that form. The suggestions are very much appreciated. And just so you don't think I hadn't searched the site: all the other posts were from several years ago (~5+) & I wondered if the resources weren't a bit dated - being for technology and all. I know not much has probably changed re: basics of the command line, but I thought in terms of resources for learning it, maybe there had been some developments. Thank you!!

May 14, 2012 6:47 AM in response to Rasuul

I couldn't disagree more with the above posters. Learning 'the Terminal' (in this case, that means Bash) is NOT 'learning Unix'. That's a common misconception. The shell and the operating system are entirely different things.


Learning the shell and how it interacts between the GUI and the operating system is immensely powerful way to learn how to take control of your Mac, or any other Unix based machine.


There are three books for learning Terminal; best to read them concurrently


Learning the Bash Shell


Bash Cookbook


Classic Shell Scripting


Apple also have a free tutorial here:


Shell Scripting Primer


However, I'd recommend going through the first three books first. It'll make a lot more sense.

May 14, 2012 7:06 AM in response to Rasuul

Just a quick caveat (and you may already be aware of this)... Using the terminal will allow you to bypass pretty much all of the security and protections built into OS X (especially if you start messing around as root). You should be sure to have a backup before trying things out (although, you should always have a backup). It's also a good idea to have a second installation (on an external drive or separate partition) to experiment on. This way if you do something that you can't undo, you won't have to reinstall your OS to get things up and running again.

May 14, 2012 6:46 PM in response to softwater

@softwater thank you so much. I really appreciate the concrete suggestions - that's exactly what I was looking for. Thank you for taking the time to share your thoughts on the matter.


@JoeyR Thanks for the sage advice. I dare say it sounds like liessons learnt from personal experience! Is it sufficient to set up a separate user or is an installation on a separate drive strictly necessary?


Thanks again!


Best,



Rax

Learning terminal - suggested reference / community guide?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.