grep doesn't show result [duplicate]

Clash Royale CLAN TAG#URR8PPP
This question already has an answer here:
Grep: unexpected results when searching for words in heading from man page
2 answers
I was trying to search in man find, and I would like to know what's going on.
$ man find | grep Like
Like -lname, but the match is case insensitive. This is a GNU
Like -name, but the match is case insensitive.
Like -path, but the match is case insensitive.
Like -regex, but the match is case insensitive.
Like -name, but the contents of the symbolic link are matched
$ man find | grep "-name"
find / ! -name "*.c" -print
find /usr/src -name CVS -prune -o -depth +6 -print
find /usr/src -name CVS -prune -o -mindepth 7 -print
$ man find | grep "name,"
and there is no such group name, then gname is treated as a group
and there is no such user name, then uname is treated as a user
What's going on? How come I can see lines that contain -name, but I don't get those results if I search for -name or name, and why does that show different things? I imagine it has to do with some “metadata” in man page not shown in the terminal, but I don't know.
shell grep man
marked as duplicate by Jeff Schaller, Community♦ Feb 4 at 21:31
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
This question already has an answer here:
Grep: unexpected results when searching for words in heading from man page
2 answers
I was trying to search in man find, and I would like to know what's going on.
$ man find | grep Like
Like -lname, but the match is case insensitive. This is a GNU
Like -name, but the match is case insensitive.
Like -path, but the match is case insensitive.
Like -regex, but the match is case insensitive.
Like -name, but the contents of the symbolic link are matched
$ man find | grep "-name"
find / ! -name "*.c" -print
find /usr/src -name CVS -prune -o -depth +6 -print
find /usr/src -name CVS -prune -o -mindepth 7 -print
$ man find | grep "name,"
and there is no such group name, then gname is treated as a group
and there is no such user name, then uname is treated as a user
What's going on? How come I can see lines that contain -name, but I don't get those results if I search for -name or name, and why does that show different things? I imagine it has to do with some “metadata” in man page not shown in the terminal, but I don't know.
shell grep man
marked as duplicate by Jeff Schaller, Community♦ Feb 4 at 21:31
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
I don't think that's the problem.
– Manuel
Feb 4 at 18:54
In my debian , usinggnu grep 3.3, the results ofgrep 'name'are much more compared togrep '-name'and includes all the results provided by'-name'. I suppose this behavior you encounter is in your grep implementation.
– George Vasiliou
Feb 4 at 20:06
@GeorgeVasiliou I usedgrep 'name,'.
– Manuel
Feb 4 at 21:32
add a comment |
This question already has an answer here:
Grep: unexpected results when searching for words in heading from man page
2 answers
I was trying to search in man find, and I would like to know what's going on.
$ man find | grep Like
Like -lname, but the match is case insensitive. This is a GNU
Like -name, but the match is case insensitive.
Like -path, but the match is case insensitive.
Like -regex, but the match is case insensitive.
Like -name, but the contents of the symbolic link are matched
$ man find | grep "-name"
find / ! -name "*.c" -print
find /usr/src -name CVS -prune -o -depth +6 -print
find /usr/src -name CVS -prune -o -mindepth 7 -print
$ man find | grep "name,"
and there is no such group name, then gname is treated as a group
and there is no such user name, then uname is treated as a user
What's going on? How come I can see lines that contain -name, but I don't get those results if I search for -name or name, and why does that show different things? I imagine it has to do with some “metadata” in man page not shown in the terminal, but I don't know.
shell grep man
This question already has an answer here:
Grep: unexpected results when searching for words in heading from man page
2 answers
I was trying to search in man find, and I would like to know what's going on.
$ man find | grep Like
Like -lname, but the match is case insensitive. This is a GNU
Like -name, but the match is case insensitive.
Like -path, but the match is case insensitive.
Like -regex, but the match is case insensitive.
Like -name, but the contents of the symbolic link are matched
$ man find | grep "-name"
find / ! -name "*.c" -print
find /usr/src -name CVS -prune -o -depth +6 -print
find /usr/src -name CVS -prune -o -mindepth 7 -print
$ man find | grep "name,"
and there is no such group name, then gname is treated as a group
and there is no such user name, then uname is treated as a user
What's going on? How come I can see lines that contain -name, but I don't get those results if I search for -name or name, and why does that show different things? I imagine it has to do with some “metadata” in man page not shown in the terminal, but I don't know.
This question already has an answer here:
Grep: unexpected results when searching for words in heading from man page
2 answers
shell grep man
shell grep man
edited Feb 4 at 19:23
Rui F Ribeiro
40.5k1479137
40.5k1479137
asked Feb 4 at 18:35
ManuelManuel
198116
198116
marked as duplicate by Jeff Schaller, Community♦ Feb 4 at 21:31
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
marked as duplicate by Jeff Schaller, Community♦ Feb 4 at 21:31
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
I don't think that's the problem.
– Manuel
Feb 4 at 18:54
In my debian , usinggnu grep 3.3, the results ofgrep 'name'are much more compared togrep '-name'and includes all the results provided by'-name'. I suppose this behavior you encounter is in your grep implementation.
– George Vasiliou
Feb 4 at 20:06
@GeorgeVasiliou I usedgrep 'name,'.
– Manuel
Feb 4 at 21:32
add a comment |
I don't think that's the problem.
– Manuel
Feb 4 at 18:54
In my debian , usinggnu grep 3.3, the results ofgrep 'name'are much more compared togrep '-name'and includes all the results provided by'-name'. I suppose this behavior you encounter is in your grep implementation.
– George Vasiliou
Feb 4 at 20:06
@GeorgeVasiliou I usedgrep 'name,'.
– Manuel
Feb 4 at 21:32
I don't think that's the problem.
– Manuel
Feb 4 at 18:54
I don't think that's the problem.
– Manuel
Feb 4 at 18:54
In my debian , using
gnu grep 3.3 , the results of grep 'name' are much more compared to grep '-name' and includes all the results provided by '-name'. I suppose this behavior you encounter is in your grep implementation.– George Vasiliou
Feb 4 at 20:06
In my debian , using
gnu grep 3.3 , the results of grep 'name' are much more compared to grep '-name' and includes all the results provided by '-name'. I suppose this behavior you encounter is in your grep implementation.– George Vasiliou
Feb 4 at 20:06
@GeorgeVasiliou I used
grep 'name,'.– Manuel
Feb 4 at 21:32
@GeorgeVasiliou I used
grep 'name,'.– Manuel
Feb 4 at 21:32
add a comment |
1 Answer
1
active
oldest
votes
The default formatting from the man page (such as for bold words) is done by interspersing control characters and letters (and the control characters aren't easily visible in the output).
$ grep 'This is a GNU' /tmp/find.out
Like -lname, but the match is case insensitive. This is a GNU
$ grep 'This is a GNU' /tmp/find.out | od -c
0000000 L i k
0000020 e - b - l b l n b n a b a m b
0000040 m e b e , b u t t h e m a
0000060 t c h i s c a s e i n s e
0000100 n s i t i v e . T h i s i
0000120 s a G N U n
You can see the backspace/overstrike pairs in the -name word. It looks fine when printed, but means that name isn't a sequence of characters in the output.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
The default formatting from the man page (such as for bold words) is done by interspersing control characters and letters (and the control characters aren't easily visible in the output).
$ grep 'This is a GNU' /tmp/find.out
Like -lname, but the match is case insensitive. This is a GNU
$ grep 'This is a GNU' /tmp/find.out | od -c
0000000 L i k
0000020 e - b - l b l n b n a b a m b
0000040 m e b e , b u t t h e m a
0000060 t c h i s c a s e i n s e
0000100 n s i t i v e . T h i s i
0000120 s a G N U n
You can see the backspace/overstrike pairs in the -name word. It looks fine when printed, but means that name isn't a sequence of characters in the output.
add a comment |
The default formatting from the man page (such as for bold words) is done by interspersing control characters and letters (and the control characters aren't easily visible in the output).
$ grep 'This is a GNU' /tmp/find.out
Like -lname, but the match is case insensitive. This is a GNU
$ grep 'This is a GNU' /tmp/find.out | od -c
0000000 L i k
0000020 e - b - l b l n b n a b a m b
0000040 m e b e , b u t t h e m a
0000060 t c h i s c a s e i n s e
0000100 n s i t i v e . T h i s i
0000120 s a G N U n
You can see the backspace/overstrike pairs in the -name word. It looks fine when printed, but means that name isn't a sequence of characters in the output.
add a comment |
The default formatting from the man page (such as for bold words) is done by interspersing control characters and letters (and the control characters aren't easily visible in the output).
$ grep 'This is a GNU' /tmp/find.out
Like -lname, but the match is case insensitive. This is a GNU
$ grep 'This is a GNU' /tmp/find.out | od -c
0000000 L i k
0000020 e - b - l b l n b n a b a m b
0000040 m e b e , b u t t h e m a
0000060 t c h i s c a s e i n s e
0000100 n s i t i v e . T h i s i
0000120 s a G N U n
You can see the backspace/overstrike pairs in the -name word. It looks fine when printed, but means that name isn't a sequence of characters in the output.
The default formatting from the man page (such as for bold words) is done by interspersing control characters and letters (and the control characters aren't easily visible in the output).
$ grep 'This is a GNU' /tmp/find.out
Like -lname, but the match is case insensitive. This is a GNU
$ grep 'This is a GNU' /tmp/find.out | od -c
0000000 L i k
0000020 e - b - l b l n b n a b a m b
0000040 m e b e , b u t t h e m a
0000060 t c h i s c a s e i n s e
0000100 n s i t i v e . T h i s i
0000120 s a G N U n
You can see the backspace/overstrike pairs in the -name word. It looks fine when printed, but means that name isn't a sequence of characters in the output.
answered Feb 4 at 19:09
BowlOfRedBowlOfRed
2,600715
2,600715
add a comment |
add a comment |
I don't think that's the problem.
– Manuel
Feb 4 at 18:54
In my debian , using
gnu grep 3.3, the results ofgrep 'name'are much more compared togrep '-name'and includes all the results provided by'-name'. I suppose this behavior you encounter is in your grep implementation.– George Vasiliou
Feb 4 at 20:06
@GeorgeVasiliou I used
grep 'name,'.– Manuel
Feb 4 at 21:32