AIX Tip of the Week

AIX Tip of the Week: Useful Korn Shell Shorthand

Audience: AIX End Users

Date: June 23, 1999

A good percentage of an Unix user's life is spent navigating between directories. A useful Korn shell shorthand, ~- (tilde-dash), can be used to reference the previous directory. Here are several examples of this useful shorthand:

cd ~-		#  cd to the previous working directory ("cd -" also works)

cp ~-/xyz . # copy file "xyz" from the previous working directory to the current directory
ls ~- # list the contents of the previous directory