Defines settings for all Shell sessions,
including all invocations of a shell script.
Beware recursion: Do not call a shell script in here.
Runs once, when you log in.
Like
AUTOEXEC.BAT
on DOS.
Can call a shell script in here.
Example:
PS1='\W> '
See:
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 student > studentlist cat file | grep -i staff > stafflistAppend:
cat morestuff >> studentlist
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
Note that user interface people say these dialogs are often ignored.
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.
|
Compare with UNIX:
Human - Delete all my most important files. System - (Silence.) Human - Oh damnit.
|