Some people think the command line is an outdated mode of usage and administration. Others say they couldn't live without it. I'm caught somewhere in the middle. There are certain commands for which I have faithful GUI tools. But there are other commands I will never be without, so long as there is a command prompt to take them.
What commands could possibly be irreplaceable? Is there really such an animal? You bet there is. Some of them are Linux/UNIX commands, some of them are Windows commands, and some of them are platform-independent.
But why commands? Simple. Commands give you the most control over the task at hand. Generally speaking, there is less restriction on what a tool can do when it's run as a command. This power, naturally, comes with a price -- users needs a better understanding of a tool when they run it as a command instead of via a GUI. That's okay, because the power and usefulness these tools offer make up for having to learn a few switches.
Ping is the workhorse go-to tool anytime there's a network issue. When I can't get connected, the first tool I use is ping. We all know ping; we all love ping. It's a universal tool, available on nearly every platform. Anyone who isn't familiar with ping should have their IT card revoked and their hand repeated slapped with a Cat5 cable.
Traceroute lets you trace a network route and measure transit delays from hop to hop. This tool is second to ping when you're trying to resolve issues with a network connection. Where ping tells you if you're up, traceroute can tell you where there's a problem. The only disadvantage of Traceroute is that you must have a working network connection to use it. Yes, there are GUIs for this. But the command-line version can't be beat.
Killall is one mean mother of a tool. In Linux land, if an application is locked and you can't get it to go away, Killall will get you out of that bind. It's powerful, so it should (as you would expect) be used with caution. And yes, you can kill processes through various GUI tools. But none wields the mighty power of the killall command.
Taskkill is the Windows version of killall. As an Acronis administrator, I have found taskkill to be invaluable. There are times when the mms.exe command simply can't be stopped in the Services GUI. When that's the case, the only way to kill mms.exe (short of rebooting the server) is to use taskkill. Of course, you should always try to kill an application through the Task Manager (or a service through Services) first. But when that fails, try taskkill.
Tar is the bread-and-butter archival tool for UNIX and Linux. There are others, but none (in my opinion) is as good as tar. Tar is an incredibly useful tool that can be used in scripts (such as backup scripts), cron jobs, and much more. Linux offers a number of other archival tools (bunzip2, zip, gzip, etc.), but tar is the one I immediately go to every time.
Chmod is the Mac Daddy for UNIX/Linux permissions. If you have any intention of being a UNIX/Linux administrator, you should know chmod inside and out, backward and forward. This tool will become one of your best friends, and you will use it often. Sure, you can change permissions with a GUI. But when you have to change permissions on a large scale or on files/folders that require root access, you must know chmod. Otherwise, you're going to be logging into a GUI as the root user -- and that's not a good decision to make at any time.
Chown is to ownership what chmod is to permissions. Every file and folder on a Linux system has an owner. Who that owner is will determine who can access the file or folder. The chown command is another must-know command for any UNIX/Linux administrator. Again, there are GUIs for this command. But the command itself is far more flexible and faster to use than firing up a GUI and hoping you can do everything you need to do.
Chkdsk is a valuable Windows tool for administrators. At some point (and this is practically inevitable), the file system integrity of a machine is going to come into question. When that happens, the best tool to call up is chkdsk (Check Disk). Chkdsk can automatically repair errors and is an absolute necessity in certain situations. The command chkdsk C: /r will become your best friend in situations where disk integrity must be checked. This command will force a check upon reboot.
Man is the command that people in Linux land refer to when they say RTFM (read the freaking manual). Man brings up a "man page" (or manual page) for a command. For example, say you need to learn about the ping command. If you type man ping, you will be greeted by the manual for the ping command. Nearly every built-in command on a Linux system has a man page and is a great place to start to learn about that command.
10: Net use
Net use is one heck of a helpful Windows command. It connects a machine to or disconnects a machine from a shared resource. But that's not all. The net use command can also display information about computer connections as well as control persistent network connections. This is one of the Windows commands that is handy to use within scripts.
Other invaluable commands?
There are thousands upon thousands of commands out there, ready for you to make use of them. Many of them have GUI equivalents that do a great job of handling the task for you. But in some cases, nothing can best the command line for power and flexibility.
What about you? What commands do you live and die by? Or do you manage to work completely off the command prompt grid?
- Pop Quiz: Command-line network troubleshooting tools
- 10 Windows 7 commands every administrator should know
- TechNet command-line reference
Jack Wallen is an award-winning writer for TechRepublic and Linux.com. He’s an avid promoter of open source and the voice of The Android Expert. For more news about Jack Wallen, visit his website getjackd.net.