Previous Section: The Shell - Command Interpretation
After you see the shell prompt ($) you can type a command. A recognized command name will always be the first item on the command line. Many commands also accept options for extended functionality, and arguments often represent a text string, a file name, or a directory name that the command should operate upon. Options are usually prefixed with a hyphen (-).
White space is used to delimit (separate) commands, options, and arguments. White space is defined as one or more blanks ([Space]) or tabs ([Tab]). Thus, for example, there is a big difference between banner Hi and bannerHi. The computer will understand the first one as the command banner with an argument to the command (Hi). The second one will interpreted as a command bannerHi, which is probably not a valid command name.
Every command will be concluded with a carriage return ([Return]). This transmits the command to the computer for execution. After this slide, the concluding ([Return]) will be understood, and generally will not be presented on the slide.
The terminal input/output supports typing ahead. This allows you to enter a command and then enter the next command(s) before the prompt is returned. The command will be buffered and executed when the current command has finished.
Multiple commands can be entered on one command line by separating them with a semicolon.
- NOTE: The UNIX system command input is case-sensitive. Most commands and options are defined in lowercase. Therefore, banner hi is a legal command whereas BANNER hi would not be understood.
- NOTE: You can type two commands on a single command line separated by a semicolon (;). For example, $ ls; pwd
Next Section: The Secondary Prompt