Regular expression – How to use an abnormal wildcard in Bash?

See answer in English> Automatically ignore files in grep 6
I want to grep multiple files in the folder. In addition to large files like pcap files and gziped files, I want to render them a lot. So I want to:

$grep foo !({*pcap*,*gz*})

But this does not work. Because although it avoids gziped files, but! The shell extension of ({* pcap *,* gz *}) will actually return pcap files. Do you know how to include all files except pcap and gziped files?

you need to change it

grep foo !(*pcap*|*gz*)

Exclude pcap and gz files

See answer in English> Automatically ignore files in grep 6
I want to grep multiple files in a folder. In addition to large files like pcap files and gziped files, I want to render them lavishly. So I thought:

$grep foo !({*pcap*,*gz*})

But this does not work. Because although it avoids gziped files, it! The shell extension of ({* pcap *,* gz *}) will actually return pcap files. Do you know how to include all files except pcap and gziped files?

You need to change it

grep foo !(*pcap*|*gz* )

Exclude pcap and gz files

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 5442 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.