开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜