1.5 Interactive Shell UseWhen you use the shell interactively, you engage in a login session that begins when you log in and ends when you exit or press [CTRL-D] . [2] During a login session, you type command lines in to the shell; these are lines of text ending in RETURN that you type in to your terminal or workstation. By default, the shell prompts you for each command with a dollar sign, though as you will see in Chapter 3 the prompt can be changed.
1.5.1 Commands, Arguments, and OptionsShell command lines consist of one or more words, which are separated on a command line by blanks or TABs. The first word on the line is the command . The rest (if any) are arguments (also called parameters ) to the command, which are names of things on which the command will act. For example, the command line lp myfile consists of the command lp (print a file) and the single argument myfile . lp treats myfile as the name of a file to print. Arguments are often names of files, but not necessarily: in the command line mail billr , the mail program treats billr as the name of the user to which a message will be sent. An option is a special type of argument that gives the command specific information on what it is supposed to do. Options usually consist of a dash followed by a letter; we say "usually" because this is a convention rather than a hard-and-fast rule. The command lp -h myfile contains the option -h , which tells lp not to print the "banner page" before it prints the file. Sometimes options take their own arguments. For example, lp -d hp3si -h myfile has two options and one argument. The first option is -d hp3si , which means "Send the output to the printer (destination) called hp3si ". The second option and argument are as above. |
|