• Shell
– Command program
– Accepts input from keyboard
– Uses input to run commands or otherwise control
computer
– Started when terminal window opened
• Shell purpose
– Make it easy for users to run programs and work
with files in Linux
– Run programs
– Pass parameters to program being started
• Behavior
– If command succeeds, no response
– If command fails, error message printed
• Command history
– Quickly call up and repeat any command from list
– Press the up arrow key at command prompt
– Press enter to execute command
• History command
– Displays entire history list
• Bang
–!
• Shell variable
– Name that can have value assigned to it
– Can be number or string of text
– Typically created using all uppercase letters
• Environment variable
– Typically defined during initialization of operating
system or user’s shell
– Can be accessed by any program
• env command
– Start program with environment variable setting
that is not part of current environment
– Only used for started program
• Set command
– Displays list of all environment variables
• Echo command
– View value of single environment variable
• Export command
– Makes newly created environment variable
available to other programs
• PATH environment variable
– Contains list of directories that shell searches
each time command is executed
• PS1 environment variable
– Defines shell prompt for bash
• Mail command
– Basic e-mail client
– Use from command line to create e-mail message
– Format: mail -s "subject line" e-mail_address
• To start:
– vi command
– Can be followed by name of file to edit
• Modal editor
– Keystrokes are interpreted differently depending
on mode you are working in
• Modes:
– Command mode
– Insert mode
– Replace mode
• Begin in command mode
– Return to command mode by pressing Esc key
• Print queue
– Printer definition
– Associate physical printer with named printer
definition
• Set up printer via GNOME desktop interface
– Choose system settings
– Print
– Follow steps in dialog
• lpr command
– Print from command line
– Uses series of filters based on type of file to print
• lpoptions command
– Save commonly used list of options
• Shell
– Command interpreter used to start programs
– Many shells are available
• Tab completion
– Helps to quickly enter long file and directory
names
• Command history
– Quickly reenter previously entered command