I want to grep multiple files in a folder. I want to grep everyone of them except big files like pcap file and gziped files. So I am trying :
$ grep foo !({*pcap*,*gz*})
But that does not work. Because while it avoid gziped files, the shell expansion of !({*pcap*,*gz*}) returns pcap files actually. Any idea how to include every files except pcap and gziped files please?
The GLOBIGNORE parameter lists files to exclude from the results of a glob expansion:
Assuming the current directory is empty:
$ touch foo1 foo2 foo3 foo10 foo11 foo12
$ GLOBIGNORE="foo1*:foo3"
$ ls *
foo2
you need to change that to
grep foo !(*pcap*|*gz*)
to exclude pcap and gz files
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With