Other UNIX Tricks ls -F lists files in directory indicating by slash which are sub dirs ls -s sorts files ls -l | sort -f alphabetical sort ls -s | sort -n numerical sort file {list of filenames} command gives info about the filenames in the list head -4 .login looks at the first four lines of a file tail -12 .login looks at the last four lines of a file or who | head -5 or head -3 /etc/passwd or cat filename | tail -5 more ~/.cshrc pg command(s) [return] N skips N screensful N l moves down N lines cntrl-D half page h help commands q quit /patterns search forward ?pattern search backward /next occurance v starts vi at current line . redraw screen $ redisplay previous screen spell word list rtn rplies with correct spelling grep command grep -c list matches -i ignore case -l match -n line numbers grep pattern file to be searched who | grep hazards awk command awk -F: Ô{print $7}Õ /etc/passwd |sort |uniq -c awk extracts 7th field of passwd file,hand to sort then lets uniq and -c to count cat filename | awk Ô{print $1}Õ | tee locate Explanation: ÒcatÓ scrolls through the file named ÒfilenameÓ and transfers the first field of each line to a file called ÒlocateÓ which is created by the ÒteeÓ command fgrep -nf locate tfsites.dat | reference If you remove any Ò!Ó from the first of the locate file, the above line will fgrep search through the file Òtfsites.datÓ for a set of strings found in ÒlocateÓ. It will print the finds along with the line number in tfsites.dat where the string is found. The tee command then creates the file reference which will receive the results of the search. sed stream editor