Chapter 14: Basic Features of the Korn and C Shells

Commands:

Command Description Examples
!! re-executes the last command in C shell  
!$ repeat the last argument from the previous command  
!* repeat all arguments of the previous command  
!n:p allows you to see a command but not execute it.  
!number repeats a specific number command  
alias The alias and unalias utilities create or remove a pseudonym or shorthand term for a command or series of commands. Change copy (cp) to include a confirmation prompt before overwritting a file:
alias cp="cp -i"
history This utility lists or edits and re-executes commands previously entered into an interactive shell. $ history
339 man grep
340 pwd
341 grep banana ./*
342 history
$ r 340
pwd
/home/user2
$
PS1 A variable which can be changed by the user to alter the appearance of the default shell prompt. $ PS1="new prompt$ "

$ PS1="$PWD $ "

r Repeats a command from the history list. 170 pwd
171 ls
172 cd ~

$ r 170

set + o vi Turns command line editing on.  
set - o vi Turns command line editing off.  
set prompt Sets the default shell prompt in a C shell. % set prompt="hello %"
set prompt Sets the default shell prompt in a C shell.  
unalias The alias and unalias utilities create or remove a pseudonym or shorthand term for a command or series of commands. $ alias cp="cp -i"
$ unalias cp
unset history Turns history tracking off.