R**a 发帖数: 51 | 1 how to find files that contain string "aaa" AND string "bbb"?
thanks |
T********r 发帖数: 6210 | 2 a silly way: grep aaa file | grep bbb
【在 R**a 的大作中提到】 : how to find files that contain string "aaa" AND string "bbb"? : thanks
|
R**a 发帖数: 51 | 3 what if one wants the output to be a list of file names, such as what you get
when using grep -l.
【在 T********r 的大作中提到】 : a silly way: grep aaa file | grep bbb
|
T********r 发帖数: 6210 | 4 sorry the previous solution is wrong. it just proves one thing:
for every complex problem there is a solution that is simple,
neat and wrong. ;-)
here's the correct one, hopefully
grep -l aaa `grep -l bbb files-to-grep`
【在 R**a 的大作中提到】 : what if one wants the output to be a list of file names, such as what you get : when using grep -l.
|