If I grep recursivley through a directory, how can i save the resulting output to a simple .txt file?
So for example, if I used the command:
grep -r "search" *
could I use a command to save the resulting out开发者_JAVA技巧put to a .txt file?
grep -r "search" * > somefile.txt
This kind of redirection is not specific to the command you are running, by the way. It is a feature of the command shell. The standard shell in linux is called bash. man bash
should give you more information than you probably want, but look for the section called REDIRECTION for a comprehensive discussion of these features.
精彩评论