Il Diario di Tinton











{2009-11-15}   find and grep Regular Expressions

Always use the extended version of the regular expressions. In find:

find -E ./ -iregex ".*((zip)|(gz))$"

is equivalent to

find .| grep  -iE ".*((zip)|(gz))$"

Use this to search for this pattern or that pattern. The parenthesis to group expressions this way only work in extended (as grep(1) calls them) or modern (as re_format(7) calls them).

In grep use -i to ignore case. In find, use -iregex to ignore case.

Advertisements


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

et cetera
%d bloggers like this: