OK, I gotta tell this joke.
Osama bin Laden gets taken out by a daisy cutter. He’s standing up there at the pearly gates, where he’s met by George Washington. “You tried to harm the country I birthed!” he said. And he sucker-punched him.
“You tried to take Americans’ liberty, so they gave you death!” screamed Patrick Henry, who popped out of nowhere. Then he threw an anvil at him.
Thomas Jefferson and James Madison came out and started tag-teaming him, followed by 68 more freedom-loving Americans wielding assorted large and heavy objects.
Finally, John Randolph decided he’d had enough, so he picked up this bloody pulp that used to be bin Laden, and threw him over to the gate for his fiery judgment.
Bin Laden looks up at an angel standing there. “This isn’t the least bit like what I was promised!” he cried.
“I told you there’d be 72 Virginians waiting for you when you got here!” the angel said. “What’d you think I said, genius?”
Let’s talk about some Unix/Linux tricks. Since yesterday’s mention of top drew some positive response, I might as well talk briefly about a few more tricks.
First, the shell itself. If you can’t remember a command, type the first letter or two and hit the tab key twice. You’ll see all the possible combinations. Tab completion also saves you keystrokes and works on filenames too. Let’s say I’m editing /etc/apache/httpd.conf, here’s the key sequence I’ll probably end up using:
It saves me more than half the keystrokes. It also lets me be lazy–as long as I remember roughly where the file is and what letter it starts with, I’ll find it quickly.
Steve DeLassus asked me once a couple of years ago why I didn’t use that trick. I said because I’d get addicted to it and hate not having it in Windows. Out of necessity I started using it. I hate Windows command prompts now.
If you want to see your disk usage, or how much space you have free, use the du and df commands. (I never have problems remembering that last one for some reason.)
If you need to see what’s inside your computer, remember the /proc subdirectory. This is Linux-specific, because each Unix variant has its own nuances about /proc. By viewing the file /proc/pci, you’ll get detailed information on the PCI devices in your computer. By viewing /proc/interrupts, you’ll find out what IRQs are in use and what’s sharing what. The /proc/scsi and /proc/ide trees will give you information on the disk subsystems. By poking around inside /proc, you can find out more about a PC than the old standby Norton Diagnostics for DOS used to tell you. Your Linux installation CD can be a valuable diagnostic tool–just boot a troublesome PC with it and hit ALT-F2 (or CTRL-ALT-F2 if it’s a distribution that uses a GUI-based installer) to switch to a console. Or use a single-floppy Linux distribution.
And as for learning this stuff, the only thing I can recommend is total immersion. I asked Charlie, our Unix sysadmin at work, how he learned Emacs. “I just set my edit variables to emacs and lived with it,” he said. “And after about a month I liked it.”
I think I’ll stick with nano or pico or joe or ee, personally. I know enough vi to be able to use it in an emergency. But his approach works for all things Unix. Either dual-boot the PC you have or pick up a cheap second PC. It’s not difficult to find an old Pentium, complete, for under $100 and a price pressure from cheap LCDs has had the nice side-effect of pushing the price of conventional CRT monitors way down. There’s enough good free Linux software out there now that you can live in Linux for long periods of time and still get the same things done in Linux that you would in Windows while you gain valuable and marketable skills.
While you’re at it, eat lots of salmon and blueberries (not necessarily together). They’re supposed to be good brain food, and that can’t hurt.
Once you’re starting to feel like you know something, pay IBM developerWorks a visit. They’ve got a certification prep series up there. You may not wish to spend the time and money to get certification, but by reading the series, you’ll get a good idea of what you know and don’t know, and you’ll learn some more good stuff in the process.