You are on page 1of 2

PART 1

single command on the command line


$ sort -r list
multiple commands on the same command line
$ ls -l | less
semicolon allows to place more than one command statement in the same command li
ne
$ cp list list.bak; cat list .bak
Special Characters
backslash (\) - "backslash escaping" allows to split a coomand statement across
multiple lines
also you can continue on a new line by typing a backslash before pressing enter
greater than (>) - allows to direct the standard output of a command to a file o
r a device such as a printed instead of to the terminal screen.
$ ls -l /usr/home > userids
less than (<) - allows to send the contents of a file to a command as its standa
rd input
-sends input from a file called list to the sort command.
pipe (|) - direct the output of one command to the input of another command
$ cat EasyNomad | grep 'South America'
ampersand (&) - at the end of a commnd statement allows to run commands in the b
ackground.
-specifies that the find command will run a long search process in the backgroun
d
$ find / -name EasyNomad &
use backslach so that shell will not recognize the text as special characters
$ echo Tours \& Accomodation
Tours & Accomodation
$
EXPANSION
brace expansion - b{all,ook}
tilde expansion - replaces the tilde with the location of the current user's hom
e directory
~vincep/file2
/usr/home/vincep/file2
parameter substitution - /bin/ksh replaces $SHELL if SHELL=/bin/ksh
command substitution - $ ( type username)
arithmetic substitution - $((72/9) replaced by 8
word splitting pathname substitution - f*.txt = fares.txt flights.txt funding.txt
wild card characters - asterisks, question marks, double slashes

COMMAND GROUPING
double ampersand- the command after this symbol executes only if the command bef
ore the && symbols produces a zero exit status
>> redirector - used to append output to a file
shebang (#!) - absolute pathname of the shell program
KORN SHELL
#!/bin/ksh
ls /usr/shared/tours || mkdir /usr/shared/tours
touch /usr/shared/tours/tourlist
echo tour directory and tourlist file created
Shell scripts are:
-ASCII text files
-have executable permissions set
-first line of a shell script identifies the command interpreter

You might also like