Quick C Shell reference
C Shell reference
Directory Manipulation
pwd
- Displays current working directory.
- Technically, this is not a command, but simply displays the
contents of the cwd variable.
cd dir
- Changes the current working directory (cwd) to the
directory dir. dir may be forms such as:
/
- Root directory.
/foo/bar
- Directory bar in directory foo in root directory.
~
- Home Directory of current user (stored in user variable).
~/foo
- Directory foo in current user's home directory.
~foo
- Home Directory of user foo.
~foo/bar
- Directory bar in user foo's home directory.
pushd foo/bar
- Pushes directory foo/bar onto directory stack and changes to it.
pushd +2
- Rotates directory stack by 2 directories.
pushd
- Switches top two elements of directory stack.
popd
- Pops directory from directory stack.
popd +2
- Pops the 3rd directory from directory stack.
dirs
- Displays directory stack. (All the pushd and popd statements do
this already.)
dirs -l
- Displays directory stack in long form (full pathnames).
History Functions
set history = 100
- Tells the C shell to remember the last 100 command lines.
history
- Displays the history list.
!!
- Executes the last command (in the history list).
!23
- Executes the 23rd command (in the history list).
!-5
- Executes the 5th to last command in the history list. (This means
that
!-1
is the same as !!
).
by Wei-Hwa Huang