Computer History - Herong's Notes - Version 3.11, by Dr. Herong Yang
Bourne Shell Command Line Examples
This section provides some Bourne shell command line examples with explanations.
Below are some Bourne shell command line examples with explanations:
set Displays the values of all shell variables. PS1=\$ Sets the prompt to be the dollar sign $ D=`pwd` Sets the current working directory to variable d. echo $D Displays the value in variable D date Displays the date. cat > myself (Type in some words about yourself) ^D Creates a file and lets you to enter text from the keyboard. ls -l Lists the contents of the current directory in long format. cat myself Displays the contents of "myself" on the screen. sleep 200 ^C A dummy command. It runs for 200 seconds. "Ctrl-C" cancels the execution of any command. sleep 200 ^Z "Ctrl-Z" stops the execution of any command. command & Runs the command in the background
Table of Contents