Professional Documents
Culture Documents
UNIX C Shell Cheat Sheet: Directory Manipulation
UNIX C Shell Cheat Sheet: Directory Manipulation
Listing Files % ls
The umask value is subtracted from 666 for new files and
from 777 for new directories.
I/O Redirection
Special Files
Input Redirection % command < filename
.cshrc This file, if it exists in your home directory, is automatically
Output Redirection % command > filename executed at login. Must begin with “#” to indicate C shell
(overwrite) script.
Output Redirection % command >> filename .cshrc typically includes C shell specific commands such
(append) as the set noclobber, set history, set savehist,
Error Redirection % command >& filename and alias commands.
(overwrite) .login This file, if it exists in your home directory, is automatically
executed at login. Must begin with “#” to indicate C shell
Error Redirection % command >>& filename
script.
(append)
.login typically contains generic UNIX commands such
Noclobber Variable % set noclobber
as the stty, set path, and umask commands.
Setting the noclobber variable protects files from being
.logout This file, if it exists in your home directory, is automatically
accidentally overwritten due to output redirection (but not
executed at logout. Must begin with “#” to indicate C shell
cp, mv, etc.). “!” following any redirection operator over-
script.
rides noclobber.
.logout typically contains commands to perform cleanup.
Piping Operator % command1 | command2