Defines settings for all C-Shell sessions,
including all invocations of a shell script.
Beware recursion: Do not call a shell script in .cshrc.
Runs once, when you log in.
Can call a shell script in here.
e.g. To put the current dir into the prompt, put the following in .cshrc:
alias setprompt 'set prompt="[`hostname`] `pwd`> "' alias cd 'cd \!*; setprompt'and the following in .login to get it started:
setpromptQuestion - Why can we not simply put this in .cshrc:
set prompt="[`hostname`] `pwd`> "See also the PATH.
Very powerful features.
Pipes - Send output of one program to input of other. e.g. Search for all lines in the file that contain "DCU" in any case, except those containing "Computing" in any case, and sort the remaining lines:
cat file | grep -i dcu | grep -iv computing | sortBackquotes - Capture the output of a program as a string:
echo Current directory is `pwd` and date is `date`Redirection - Read input from a file, send output to a file.
prog < inputfile > outputfile cat file | grep -i ca2 > ca2list cat file | grep -i cae2 > cae2listAppend:
cat morestuff >> ca2list
h history of recent commands (numbered) !n replay command number n !string replay last command beginning with string !! last command examples !6 | sort !ls | grep -v html
Human - Delete all my most important files. System - Are you sure? Human - Yes Yes. System - Are you really sure? Human - Yes Yes. System - All your most important files deleted. Human - Oh damnit.
"ls -l" shows something like:
-rwxr-xr-- 1 userid groupid 153 Nov 6 1998 filename - file (d for directory, l for link/shortcut) rwx User (u) can read,write,execute. r-x Other members of group (g) can read,execute only. r-- Other people (o) can read only. Change with "chmod". For more see protections (next).
To mount a floppy disk drive:
volcheckThen access the floppy files through the path:
/floppyNote there are no "drives" as in DOS/Windows. Instead everything is mapped to some "virtual" subdirectory of the root / even if you are actually moving around different hardware devices. DOS/Windows could do this too of course:
/C/My Documents/ /A/See also:
eject