Example Commands

# Execute multiple commands on one line

					$ pwd ; ls tmp ; print "Hello world"
				

# Run the find command in the background

					$ find . —name tmp.out —print &
				

# Connect the output of who to grep

					$ who | grep fred
				

# Talk to fred if he is logged on

					$ {who | grep fred ;} && talk fred
				

# Send ls output to ls.out, even if noclobber is set

					$ ls >| ls.out
				

# Append output of ls to ls.out

					$ ls >> ls.out
				

# Send invite.txt to dick, jane, and spot

					$ mail dick jane spot < invite.txt
				

# List file names that begin with z

					$ ls z*
				

# List two, three, and four character file names

					$ ls ?? ??? ????
				

# List file names that begin with a, b, or c

					$ ls [a-c]*
				

# List file names that do not end with.c

					$ ls *[!.c]
				

# List file names that contain ...

Get Korn Shell: Unix and Linux Programming Manual, Third Edition, The now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.