|
resources
|
Unix Basics for OSX UsersNote: This super-basic introduction is geared towards OSX users. There are I'm sure dozens of bettter tutorials out there, so please look; but, hopefully this will help get you started.
First off, beware that some of these commands might not work correctly if you're not using the 'Bash' shell. You'll know your using 'Bash' if when you open Terminal the window's title-bar says something like "Terminal-bash-80x36". If it doesn't say Bash in there, use your mac's System-Help to find a file that explains 'changing to a different shell'.
...
Unix is a beautiful thing. I find Unix extremely poetic and interesting, and it really seems to bring out the dork in me. Learning just a little bit about using Unix (also known as programming at the command-line) can really really help you better understand how your Mac or Linux machine works, about what's going on under-the-hood. Basically, understand this: whenever you click on an icon, move a file somewhere, open an application, delete a file, upload a file to your website, etc, you are secretly using Unix. The GUI of the Finder and the other programs you use just hide the nitty-gritty of command-line from you by allowing you to click a button or two that automate those tasks. By learning more about Unix you can potentially gain more low-level control of your machine; you'll also be able to use various pieces of software that can only be installed and accessed from the command-line.
...
Here's how to get started: Go to your Utilities folder and open the Terminal application. You'll be presented with your user name and a prompt. Magical, right? Well at this point you have to start learning some commands, but you really don't need to know that many to get around and do basic stuff.
Type in the following: cd /Applications ls
You just did two things.
mkdir Dev_Apps ls
You just made a folder named Dev_Apps. If you want, confirm that it's there by going to the Finder and opening the physical Applications folder. Now let's pretend we hate programming and want to delete the folder we just made:
rmdir Dev_Apps ls
...
So far we've been searching for things relative to the directory we're currently sitting in. For instance, we can move around simply by typing a
cd /Applications cd Utilities
We could've also typed this instead:
Notice for a moment the forward-slash (
...
Can't remember what files or folders are in your current directory? Here's a tip for the forgetful. Start typing
Note that file and folder names with spaces or special characters have to use the backward slash (\), known as the escape character. For instance, to go to the folder 'Apps Dev (new)', you have to type:
That's when the TAB trick really comes in handy...
...
One way to learn more about Unix commands is to use your computer's built-in Unix manual. To open the manual you'll use the
Try this for several different commands like
...
This is just a super basic look at how Unix works. There's definitely more than this, but not really that much more is needed for getting around and doing the basics. There's tons more resources online that go through all of the different commands, their flags, etc, in much better detail than I have provided here. One decent-looking intro that I just found is located at WebMonkey.com, but there should be plenty of other more comprehensive ones all over the place...
If you're really into books and you're a beginner, I recommend checking out the O'Reilly book Learning Unix for Mac OSX Panther for a decent tutorial on Unix commands. I still find it to be pretty helpful sometimes, though not all the time.
. . .
PLEASE NOTE: For a number of personal reasons I am currently unable to support this page and am unable to respond to any further questions, requests, demands, etc posted here. I sincerely apologize for this. The material above is simply presented as archival material (some of it incomplete) of a project that I am not actively involved with anymore, and it will probably not be updated any further. You are free to use it in whatever non-commercial ways you wish (see the CreativeCommons license below). In addition, feel free to use the comments-section below to post ideas, solutions, or to ask questions, but with the understanding that any queries will have to be answered by the community at large - not by me. Thanks for understanding.
|