REGULAR EXPRESSION WITH GREP – DOT

grep  searches  the  named input FILEs (or standard
input if no files are named, or if a single hyphen-minus
(-) is given as file name) for lines containing a match
to the given PATTERN.  By default, grep prints the matching
lines.

commandline session

$ cat first.txt
name-jeffrin
Age-35
Sex-Male
$ grep 3. first.txt
Age-35
$ grep A. first.txt
Age-35
$ grep A first.txt
Age-35
$ grep . first.txt
name-jeffrin
Age-35
Sex-Male
$ grep x.M first.txt
Sex-Male
$ grep n. first.txt
name-jeffrin
$ grep 5. first.txt
$ grep 5. first.txt
$

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 )

Google photo

You are commenting using your Google 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 )

Connecting to %s