next up previous contents
Next: chmod Up: Helpful Unix Commands Previous: cp   Contents

grep

This is the string search utility. It will search for the string in single quotes in the file given and return to standard output the line that contians that string. This command is useful when used in conjunction with the pipe command.

lightning:~>grep 'the' dictionary.txt

This will print every line of the file dictionary.txt in which the string 'the' appears.

lightning:~>ls | grep .mp3

This will print those lines of text in the output of the ls command that contain the string .mp3.



Computer Support Group 2002-10-07