So I’ve been getting a lot of friends asking me how they can get savvy on Linux lately. I partially blame Microsoft and Apple both. Microsoft has done a great job lately of actively discouraging Windows adoption (Windows 8, amirite??) while Apple has rode a wave of success on OS X as their often best-in-class laptops have become widely adopted. Here’s my favorite ugly truth about OS X: it’s Linux. Don’t tell anybody, we don’t want to scare them, but that terminal app? Yup. While it has gotten a lot better since the PowerPC days, OS X still needs you to open a terminal window every now and then… and how seductively powerful it is once you start learning a little. Then, one drunken night, you pop open your terminal or download Ubuntu onto a thumb drive and say:
“Fuck it. We’re doing this.”
It’s okay. We’ve all been there. Don’t panic. Try typing this:
ls. Alright, now you know where you are. Let’s stop pretending we’re kids smashing papers into folders on our Dad’s desktop and generally making a mess of ourselves, okay? You see files and directories.
Now try this: type
cd Desktop and hit enter. Wow. That wasn’t very exciting. The prompt now says Desktop in it. Try that
ls command again. Different stuff, huh? All that crap that you’ve been pulling out of e-mails and web sites that you hadn’t gotten around to putting anywhere better, right? Now go back up one level by typing
cd ... Where are you?
The same fucking place you started at. Boom. Now try this piece of magic: Type
cd De and hit
Tab. Did it figure out what you actually wanted to type? Maybe finished typing the word Desktop for you?
Have you caught the fever, yet? I’m not going to tell you how to do everything. That’s not really the point of this. I want to give you some tricks on how you can learn more.
Discipline. If you have a system like OS X or Linux (with a GUI), keep a terminal window open. When you need to do anything with the file system, figure out how to do it there. Once you learn some program names, start trying to use it as your application launcher. Only reach for the mouse when you have to consult a web site for help.
linuxcommand.org is a fantastic primer. I’m not interested in reinventing their great work. Also, try virtually any command you can give the system followed by a
--help. These are called arguments (not just something you had with your parents as an adolescent). They will also give you some shorthand answers to your questions. If you still have questions, try typing
man command, where command is whatever thing you’re trying to figure out (like
man ls); this will give you the full manual.
Tab it out. The
Tabkey is your friend. It autocompletes commands, filenames, directories, everything. Hit it once and nothing happens, maybe there are multiple things that it could be. It it twice and the terminal should display all of the possibilities. If it doesn’t display anything, you misspelled what you wanted or you want something that doesn’t exist. Either way, it saves you a lot of typing and headaches.
With a bit of practice, you’ll be computing like nobody’s business and ready to write scripts to automate your work and totally hack the planet. Or at least impress your nerd friends with how fast you navigated their Mac’s hard drive to find all of their porn.