[Nottingham] Help... How to grep four words in a file appearing in any permutation?

Jason Irwin jasonirwin73 at gmail.com
Mon Nov 23 15:46:33 UTC 2015

On 23/11/15 15:33, Martin wrote:
> How to grep for four words in a file that can appear in any permutation?
All on one line?

grep alpha my.file | grep beta | grep gamma | grep delta

That works in my *very* simple test. A quick DDG shows a few examples
using AWK and the like:

awk '/alpha/&&/gamma/&&/delta/&&/beta/' my.file

║ Jason Irwin ║ OpenPGP (GPG/PGP) Public Key: 0xD0C592B1 ║
║             ║ Import from hkp://pgp.mit.edu            ║

More information about the Nottingham mailing list