Note that you can use " " to enclose the pattern or ' '. Use of ' ' allows you to substitute for shell variables. In general " " is weaker than ' '. grep -n '.*' reg.txt grep -n '^.*' reg.txt 1:However, this is too late. 2:It may well be the end. 3:My area code is (626) 4:213 was the old area code for LA. 5: 6:This is an htlm fragment: Hello.txt 7: 8: grep -n '^However' reg.txt 1:However, this is too late. grep -n 'end.$' reg.txt 2:It may well be the end. grep -n '[0-9]' reg.txt #Search for one digit 3:My area code is (626) 4:213 was the old area code for LA. grep -n '[0-9][0-9]*' reg.txt #Search for one or more digits 3:My area code is (626) 4:213 was the old area code for LA. grep -n '^$' reg.txt #blank line 5: 8: grep -n '^ *$' reg.txt #white space line 7: grep -n "[0-9]\{3\}-[0-9]\{2\}-[0-9]\{4\}" #Social Security Number grep -n '<[^>].*>' reg.txt #Simple HTML tag (same line) grep -n '<[^>].*/a>' reg.txt grep -n '<[^>].*\/a>' reg.txt grep -n '<[^>].*\a>' reg.txt 6:This is an htlm fragment: Hello.txt