Quote:
Originally Posted by sumeet inani
find . | xargs grep -i pattern
Can you explain the working of this command.I read man page of xargs but did not understand its role here.
|
Loosely, xargs takes the input and causes it to be used as an argument list by the next command.
Example:
Code:
[mherring@Ath play]$ find . |grep brown
[mherring@Ath play]$ find . |xargs grep brown
./words:brown
[mherring@Ath play]$ grep brown *
words:brown
In the first case, grep just looks in the filename, with xargs it reads the files---just as if the third case was used.