Datasheet

676
Why Use the Keyboard?
Automate to elevate
If all these benefits are beginning to excite you, hold on to your socks! Not
only can you perform complex commands with the command line, you can
go even one step further: automation. If you find yourself using the same set
of commands more than once, you’re a likely candidate for using automa-
tion to save time. Instead of typing the list of commands each time, you can
save them to a text file and execute the entire file with only one command.
Now that’s power, right up there with the dynamic duo of AppleScript and
Automator! (Granted, it’s not graphical like Automator, but then again UNIX
has been around for decades.)
Of course, you probably don’t like doing housekeeping tasks while you’re
busy on other things, so schedule that list of commands to run in the middle
of the night while you’re fast asleep. The command line lets you do that, too.
Note that automation of UNIX commands is totally separate from automation
of Mac OS X applications with AppleScript and Automator, which I cover in
Book VIII, Chapter 2.
Remote control
“So, Mark, the command line is the cat’s meow for efficiently accessing and
working with files on my Mac, and I can use it to automate many operations.
Anything else?” I’m glad you asked! By using the command line, you can also
send commands to another computer anywhere in the world (as long as you
know the right login and password). After you log into another computer,
you can use the same commands for the remote computer.
UNIX was created with multiple users in mind. Because computers used to
be expensive (and honking huge machines to boot), UNIX was designed so
that multiple users could remotely use the same machine simultaneously. In
fact, if Mac OS X is your first encounter with UNIX, you might be surprised to
know that many UNIX beginners of the past weren’t even in the same room,
building, state, or even country as the computer that they were using.
Not only can you work with a computer that’s in a different physical loca-
tion, but it’s also very fast to do so. Instead of the bandwidth hog that is
the Internet, the command line is lean and mean. This permits you to use
a remote computer nearly as fast as if it were sitting on the desk in front of
you. (This is a great advantage for road warriors who need to tweak a web or
an e-mail server from a continent away.)
55_9781118022061-bk08ch01.indd 67655_9781118022061-bk08ch01.indd 676 8/10/11 9:39 AM8/10/11 9:39 AM