I have list of compressed files in a directory /var/log/bb e.g. console.log.1.xz, console.log.2.xz etc. I would like to grep a particular string from these files in a single command. Any ideas on how to achieve this
I have been trying like this
sudo xzcat /var/log/bb | grep 'string'
grep 'string'you aren't greping a string, you're grepping a regexp so naming itstringis misleading at best. You should either writegrep 'regexp'orgrep -F 'string', whichever it is you want to do.