grep -ril word1 /some/path/to/search | xargs grep -i word2
grep in the matched file
Leave a reply
grep -ril word1 /some/path/to/search | xargs grep -i word2
grep -rl oldtext . | xargs sed -i 's/oldtext/newtext/g'
cat some_file.txt | grep -a sme_string
find . -type f -exec bash -c 'grep -q "some_string" < <(head -n 1 "$1")' _ {} \; -printf '%p\n'
Useful to compare list of data
grep -f list.txt search_file.txt
export GREP_OPTIONS='--color=always'
find /path -type f -exec grep PATTERN {} +
To get max value, you can this way:
getconf ARG_MAX