Note that the code above is doing roughly the same as:$ ls /path/*.log | grep -v filename_exclude_pat | xargs grep -h line_include_pat >output.txt
right, but note also that the above is doing roughly the same as (a bit expensive as it process every line of unneeded files even if skip them):
perl -lne 'next if $ARGV=~/filename_exclude_pat/;print if $_=~/line +_include_pat/' *.log > output.txt
L*
In reply to Re^2: Need help copying "logs" to another file. -- oneliner
by Discipulus
in thread Need help copying "logs" to another file.
by REsaY
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |