In what I’d like to make a weekly series, I’m going to begin sharing Unix (stuff you do in the Terminal, for the uninitiated) tips for those wishing to learn more about it in the New Year. Or just learn more about it because you want to. Either way, welcome!
I’ve been thinking about doing this for a week or so, and it seems like just the right time too, as there’s a good thread that’s started in the TAB Community on just this subject. But since not everyone will make it there, I’ll be sure to capture some tip here from week to week. You know, something for the casual readers. Anyway, let’s get to it.
Since these tips are focused on helping the folks who want to get their feet wet, or are newer to OS X and its Unix underpinnings, I wanted to start with a tip that will significantly enhance your ability to figure things out and dig around in the Command Line Interface (CLI), which is accessed through the Terminal. In order for us to get started, you’ll need to open the Terminal which can be found in your /Applications/Utilities folder.
Obviously with nothing more than a cursor blinking at you, you’re going to have to know commands in order to get around the system in this manner. Using the Tab key will significantly assist you in remembering and correctly typing these commands. You see, as you start to type a command and you aren’t sure of the spelling or syntax, you hit the Tab key and it will help you out.
An example: If you type ‘his’ and hit Tab, your ‘his’ will be completed to read ‘history’ and now you can hit Return and execute the command.
Or say you want to do a delete command and remember that it starts with ‘rm’ (think, remove) but can’t recall if there’s more to the command. Hit Tab, and it will give you a listing of all the commands that start with ‘rm’.
You can also use it when you’re navigating through file structures and don’t feel like typing full names of directories. The command, ‘cd ~/Doc’ and a Tab will turn into ‘cd ~/Documents/’
In the last example there are a couple other little bits that I’ll explain while we’re here. ‘cd’ stands for Change Directory, and the tilde (~) represents your home directory. So the command ‘cd ~/’ signifies that you want to change to a path that originates in your Home directory.
So there you have it. I don’t plan on any particular order of posting these tips, so if I make mention of something trivial that hasn’t been discussed before, I’ll do my best to explain it as well, to avoid creating confusion rather than helping combat it.
As you play in the Terminal, the Tab key will be a good friend, as it will help you discover and remember commands that you’re not yet used to. Before long, it’ll either become committed to muscle-memory, or you’ll pick things up without and and find that you don’t need to lean on it any longer.