将手册页输出重定向到文件会导致单词中出现双字母

2023-11-23

我重定向了输出man djpeg到一个文本文件中,以便我在学习使用它时可以参考它。我的指示是man djpeg > textfile.txt。但是,输出看起来像这样:

LS(1)                     BSD General Commands Manual                    LS(1)

NNAAMMEE
     llss -- list directory contents

SSYYNNOOPPSSIISS
     llss [--AABBCCFFGGHHLLOOPPRRSSTTUUWW@@aabbccddeeffgghhiikkllmmnnooppqqrrssttuuwwxx11] [_f_i_l_e _._._.]

DDEESSCCRRIIPPTTIIOONN
     For each operand that names a _f_i_l_e of a type other than directory, llss
     displays its name as well as any requested, associated information.  For
     each operand that names a _f_i_l_e of type directory, llss displays the names
     of files contained within that directory, as well as any requested, asso-
     ciated information.

     If no operands are given, the contents of the current directory are dis-
     played.  If more than one operand is given, non-directory operands are
     displayed first; directory and non-directory operands are sorted sepa-
     rately and in lexicographical order.

     The following options are available:

     --@@      Display extended attribute keys and sizes in long (--ll) output.

     --11      (The numeric digit ``one''.)  Force output to be one entry per
             line.  This is the default when output is not to a terminal.

     --AA      List all entries except for _. and _._..  Always set for the super-
             user.

     --aa      Include directory entries whose names begin with a dot (_.).

     --BB      Force printing of non-printable characters (as defined by
             ctype(3) and current locale settings) in file names as \_x_x_x,
             where _x_x_x is the numeric value of the character in octal.

     --bb      As --BB, but use C escape codes whenever possible.

[...continues]

还有更多,但你明白了。为什么有些角色会重复?另外,如果某个函数执行两次或缓存刷新不正确,为什么它不重复所有这些?


一种更简洁的方法是首先将输出通过管道传输到“col -b”:

man djpeg | col -b > textfile.txt

Source: https://unix.stackexchange.com/a/15866

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

将手册页输出重定向到文件会导致单词中出现双字母 的相关文章

随机推荐