a conceptual introduction to the linux/unix command line
May 27, 2014
I did a quick search to see what kinds of tutorials and resources were out there for learning the command line (CLI) for unix/linux (note: since this is introductory stuff and few people need to know or care about the distinction between ‘unix’ and ‘linux’, I’m going to use ‘linux’ since it is the more recognizeable term).
My searches largely yielded resources like Linuxcommand.org’s tutorial/book and this seems all well and good… but I know one of the reasons why I personally have issues with books structured like this is that they only give concrete details without explaining or going over some of the conceptual stuff.
For the sake of simplicity, if you want to try any of this stuff but aren’t using a machine with a terminal emulator, I just tested out this website offering linux shell sandboxes. They are learning environments. You’ll have to set up an account to use the service (they have a free option). If you are using a Mac, you can find your terminal by searching ‘terminal’ in spotlight. If you are using windows, I’d suggest using msysgit since it has the easiest set up and will have everything you need for learning the basics. Linux users will most likely already know how to access the CLI1.
The first thing I really want to talk about is how many of the commands in the CLI are either abbreviations or acronyms. The reason why this is useful to know, especially when you are starting out, is because you can use them as mnemonics to help you remember stuff. Also for learning and understanding some of the conventions that you can carry from one CLI program to another.
pwd command in bash is an acronym for ‘print working directory’. ‘Directories’ are what they called ‘folders’ before we had the desktop metaphor to work with. All this does is tell you where you are in the system (which folder you are currently in). Do you know how many times I googled this before realizing that it stood for ‘print working directory’? Too many. Now? This is a command I use frequently.
man command is an abbreviation for ‘manual’. You use this command whenever you want the instructions for a particular program (not all CLI programs have manuals, but many do). I literally only learned/realized this a week ago. Since then, I’ve been using it for quickly referencing stuff once I realized that a lot of my google searches were just bringing me to a webpage version of the manual. (You usually run the command by entering
man [program name].