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出力の文字順序ではないという意味です。

おすすめ記事