shell
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
shell [2009/10/28 13:16] – created alan | shell [2010/06/11 12:17] (current) – removed 172.26.14.218 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== Shell tips ===== | ||
- | ===== Searching for a String in Multiple Files ===== | ||
- | Ever need to search through all your files for a certain word or phrase? You probably know about the grep command, but did you know it's recursive? | ||
- | |||
- | Here's an example. In this case we're searching for the word " | ||
- | |||
- | < | ||
- | |||
- | By using the " | ||
- | |||
- | If you'd rather just get the file names and skip the rest of the output, use the " | ||
- | |||
- | < | ||
- | |||
- | Here's another tip: grep also supports regular expressions, | ||
- | |||
- | < | ||
- | |||
- | That command will print a list of files containing any word starting with " | ||
- | |||
- | You can also use grep to search for multiple words: | ||
- | |||
- | < | ||
- | |||
- | And, of course, grep supports file name wildcards in the standard unix fashion. In this example, grep will search only file names starting with " | ||
- | |||
- | < |
shell.1256735807.txt.gz · Last modified: (external edit)