Please tell me the commands to do what you want to do below.
$ls
log1
log2
log3
$catword.txt
Apple
google
facebook
$catword.txt | xargs grep-nr.
This won't work!
You want to search log1-3 in the current directory for lines that contain at least one of the strings Apple, Google, or Facebook.Finding, grep, and xargs combinations of find, grep, and xargs can be used to search for specific words across multiple files, but I couldn't find out what I wanted to do.
Thank you for your cooperation.
linux
For Linux, I think it's GNU grep, so use the -f
option.
$grep-word.txt log {1..3}
© 2024 OneMinuteCode. All rights reserved.