Running Commands Flashcards
Command line interface advantages…?
Efficiency and flexibility. (Simplicity is not one of them.)
If commands entered on the command line were compared to English sentences, the commands could be thought of as…?
having verbs, adverbs, and direct objects. (The verb is the command to run, the adverbs are the various command line switches that can be used to modify the behavior of the command (“quietly”, or “verbosely”), and any remaining words are the direct objects (what the command is supposed to act on). Again, as in languages, there are irregularities, and for almost every rule mentioned, there will be exceptions.)
First word of any command is generally the …?
Name of a program that lives as a file somewhere in the filesystem. (For example, the previous lessons used the ps and who commands. If we want to know which file contains these programs, there is a program called which which can help us. The which command, followed by the name of another command, will tell you “which” file is being run.)
when running a command, the shell process asks…?
the kernel to execute the specified program as a separate process, and arranges the output (or, more correctly, the standard out stream) of the process to be written to the terminal. The shell then pauses until the command’s process terminates. Once the command finishes, the shell prints another prompt, and waits to be told what to do next.)
Many commands can have their behavior modified by…?
Specifying different command line switches. (An easy example is the ls command, which is used to list the contents of a directory.) (Continued on next cards)
ls /usr …?
Simply lists the contents of the directory.
ls -s /usr …?
Includes the -s command line switch, gives the sizes of the content as well.
ls -l /usr …?
Gives a “long” listing including all kinds of details about the files, such as ownerships, permissions, and modify times.
-s and -l, are single letter switches. These are referred to as…?
“short” command line switches. (Sometimes, short command line switches can also take an argument. For example, the ls command has a -w command line switch, which specifies how “wide” the output should be, in characters.)
Command line switch arguments simply follow the…?
Command line switch.
How do you know which command line switches take arguments and which don’t?
Short answer is through experience.
More than ____ command switch can be used at a time.
One
Multiple command line switches are simply…?
bunched together, squeezed between the command and any command arguments.
Often, when using multiple command lines switches, users will take…?
Advantage of a shortcut that lets all switches be “piled together” onto one hyphen (-).
All of the single letter switches that don’t take an argument, in this case -s and -r, can be piled together, sharing a…?
Single -