Unix and Linux Discussions Tagged with lines |
|
Thread / Thread Starter |
Last Post |
Replies |
Views |
Forum |
|
|
|
7 |
24,921 |
UNIX for Beginners Questions & Answers |
|
|
|
6 |
14,134 |
UNIX for Beginners Questions & Answers |
|
|
|
4 |
16,577 |
UNIX for Beginners Questions & Answers |
|
|
|
5 |
14,486 |
UNIX for Advanced & Expert Users |
|
|
|
1 |
4,738 |
UNIX for Beginners Questions & Answers |
|
|
|
4 |
9,709 |
UNIX for Beginners Questions & Answers |
|
|
|
13 |
10,955 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
6,730 |
UNIX for Beginners Questions & Answers |
|
|
|
5 |
16,764 |
Shell Programming and Scripting |
|
|
|
5 |
16,318 |
Shell Programming and Scripting |
|
|
|
1 |
3,608 |
UNIX for Beginners Questions & Answers |
|
|
|
7 |
16,745 |
Shell Programming and Scripting |
|
|
|
6 |
4,279 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
9,228 |
UNIX for Advanced & Expert Users |
|
|
|
2 |
14,948 |
Programming |
|
|
|
2 |
3,214 |
UNIX for Beginners Questions & Answers |
|
|
|
3 |
7,614 |
Shell Programming and Scripting |
|
|
|
1 |
10,463 |
Shell Programming and Scripting |
|
|
|
1 |
9,109 |
UNIX for Beginners Questions & Answers |
|
|
|
4 |
8,015 |
UNIX for Beginners Questions & Answers |
|
|
|
6 |
9,437 |
UNIX for Beginners Questions & Answers |
|
|
|
5 |
7,930 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
5,633 |
UNIX for Beginners Questions & Answers |
|
|
|
10 |
4,445 |
UNIX for Beginners Questions & Answers |
|
|
|
3 |
5,916 |
UNIX for Beginners Questions & Answers |
|
|
|
3 |
6,498 |
Shell Programming and Scripting |
|
|
|
2 |
4,407 |
Shell Programming and Scripting |
|
|
|
6 |
10,535 |
Shell Programming and Scripting |
|
|
|
1 |
5,996 |
Shell Programming and Scripting |
|
|
|
3 |
8,416 |
Shell Programming and Scripting |
|
|
|
4 |
5,430 |
Shell Programming and Scripting |
|
|
|
5 |
4,581 |
UNIX for Beginners Questions & Answers |
|
|
|
8 |
5,554 |
UNIX for Beginners Questions & Answers |
|
|
|
4 |
2,171 |
UNIX for Beginners Questions & Answers |
|
|
|
4 |
2,870 |
UNIX for Beginners Questions & Answers |
|
|
|
3 |
3,645 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
3,199 |
UNIX for Beginners Questions & Answers |
|
|
|
18 |
6,327 |
UNIX for Beginners Questions & Answers |
|
|
|
6 |
2,663 |
UNIX for Beginners Questions & Answers |
|
|
|
7 |
8,750 |
UNIX for Beginners Questions & Answers |
GREP(1) General Commands Manual GREP(1)
NAME
grep - search a file for lines containing a given pattern
SYNOPSIS
grep [-elnsv] pattern [file] ...
OPTIONS
-e -e pattern is the same as pattern
-c Print a count of lines matched
-i Ignore case
-l Print file names, no lines
-n Print line numbers
-s Status only, no printed output
-v Select lines that do not match
EXAMPLES
grep mouse file # Find lines in file containing mouse
grep [0-9] file # Print lines containing a digit
DESCRIPTION
Grep searches one or more files (by default, stdin) and selects out all the lines that match the pattern. All the regular expressions
accepted by ed and mined are allowed. In addition, + can be used instead of * to mean 1 or more occurrences, ? can be used to mean 0 or 1
occurrences, and | can be used between two regular expressions to mean either one of them. Parentheses can be used for grouping. If a
match is found, exit status 0 is returned. If no match is found, exit status 1 is returned. If an error is detected, exit status 2 is
returned.
SEE ALSO
cgrep(1), fgrep(1), sed(1), awk(9).
GREP(1)