Heres something for you.
See explanation below. Hope it helps. i suppose it would be useful to find certain lines of code in a file perhaps.
1. fgrep '***' *
2 fgrep '[ ] * ? $' filex
EXPLANATION
1.
Displays any line containing three asterisks from each file in the present directory. All characters are treated as themselves (i.e., metacharacters are not special).
2.
Displays any lines in filex containing the string enclosed in quotes.
Definition: metacharacter: A character that is used to carry a special meaning, such as a caret (^, beginning of line), a dollar sign ($, end of line), or an asterisk (*, match any character). To use one of these characters without special meaning, you must either precede it with a backslash () or enclose it within quotation marks. Bypassing the special meaning of a metacharacter is called escaping or quoting the character.= fgrep bypasses the special meaning of these characters:-)
Last edited by hotspur919; 06-06-2011 at 03:32 PM.
|