grep에 결과가 표시되지 않습니다.

grep에 결과가 표시되지 않습니다.

검색하려고 하는데 man find무슨 일이 일어나고 있는지 알고 싶습니다.

$ 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

어떻게 되어가나요? 포함된 행을 볼 수 있지만 해당 결과를 검색하거나 -name,얻지 못하는 경우 다른 내용이 표시되는 이유는 무엇입니까? 나는 이것이 터미널에 표시되지 않는 매뉴얼 페이지의 일부 "메타데이터"와 관련이 있다고 생각하지만 잘 모르겠습니다.-namename,

답변1

매뉴얼 페이지의 기본 형식(예: 굵은 글꼴)은 제어 문자와 문자를 삽입하여 수행됩니다(제어 문자는 출력에서 ​​쉽게 볼 수 없음).

$ 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

-name 단어에서 백스페이스/재점수 쌍을 볼 수 있습니다. 인쇄하면 괜찮아 보이지만 이는 name출력의 문자 순서가 아니라는 의미입니다.

관련 정보