This is a ManXample entry for the "grep" command.

  • Grep is used to search through the output of other commands or sources for strings, the following are some common invocations:

1) To search all running processes and daemons for the string "happy", use the following command:

  • sudo ps -aux | grep happy

2) To search a file for the string "happy" and put the results in a file, use the following command:

  • sudo cat file.txt | grep happy > output.txt

ManXamples/grep (last edited 2008-08-24 15:49:22 by martin0641)