match any character | . | grep l..n filename | finds 'lynn' or 'loan' |
match only if at the beginning of a line | ^ | grep ^day filename | finds 'day into night'but not 'Some day' |
match only if at the end of the line | $ | grep day$ filename | finds 'One fine day'but not 'Monday is good' |
search for '.' or '^' or '$' in a file | \ | grep \* filename | finds '*****1.05' |
search for a set of names | [] | grep [dog,dil]bert filename | finds 'dogbert' and 'dilbert' |
find all lines that start with an alphabetic character in upper or lower case | ^[] | grep ^[A-Z,a-z] filename |
Monday, March 21, 2011
Grep
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment