⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 coreutils.texi

📁 Linux下文件工具。
💻 TEXI
📖 第 1 页 / 共 5 页
字号:
@item --traditional@opindex --traditionalRecognize the non-option arguments that traditional @command{od}accepted.  The following syntax:@smallexampleod --traditional [@var{file}] [[+]@var{offset}[.][b] [[+]@var{label}[.][b]]]@end smallexample@noindentcan be used to specify at most one file and optional argumentsspecifying an offset and a pseudo-start address, @var{label}.  Bydefault, @var{offset} is interpreted as an octal number specifying howmany input bytes to skip before formatting and writing.  The optionaltrailing decimal point forces the interpretation of @var{offset} as adecimal number.  If no decimal is specified and the offset begins with@samp{0x} or @samp{0X} it is interpreted as a hexadecimal number.  Ifthere is a trailing @samp{b}, the number of bytes skipped will be@var{offset} multiplied by 512.  The @var{label} argument is interpretedjust like @var{offset}, but it specifies an initial pseudo-address.  Thepseudo-addresses are displayed in parentheses following any normaladdress.@end table@node Formatting file contents@chapter Formatting file contents@cindex formatting file contentsThese commands reformat the contents of files.@menu* fmt invocation::              Reformat paragraph text.* pr invocation::               Paginate or columnate files for printing.* fold invocation::             Wrap input lines to fit in specified width.@end menu@node fmt invocation@section @command{fmt}: Reformat paragraph text@pindex fmt@cindex reformatting paragraph text@cindex paragraphs, reformatting@cindex text, reformatting@command{fmt} fills and joins lines to produce output lines of (at most)a given number of characters (75 by default).  Synopsis:@examplefmt [@var{option}]@dots{} [@var{file}]@dots{}@end example@command{fmt} reads from the specified @var{file} arguments (or standardinput if none are given), and writes to standard output.By default, blank lines, spaces between words, and indentation arepreserved in the output; successive input lines with differentindentation are not joined; tabs are expanded on input and introduced onoutput.@cindex line-breaking@cindex sentences and line-breaking@cindex Knuth, Donald E.@cindex Plass, Michael F.@command{fmt} prefers breaking lines at the end of a sentence, and tries toavoid line breaks after the first word of a sentence or before the lastword of a sentence.  A @dfn{sentence break} is defined as either the endof a paragraph or a word ending in any of @samp{.?!}, followed by twospaces or end of line, ignoring any intervening parentheses or quotes.Like @TeX{}, @command{fmt} reads entire ``paragraphs'' before choosing linebreaks; the algorithm is a variant of that in ``Breaking Paragraphs IntoLines'' (Donald E. Knuth and Michael F. Plass, @cite{Software---Practiceand Experience}, 11 (1981), 1119--1184).The program accepts the following options.  Also see @ref{Common options}.@table @samp@item -c@itemx --crown-margin@opindex -c@opindex --crown-margin@cindex crown margin@dfn{Crown margin} mode: preserve the indentation of the first twolines within a paragraph, and align the left margin of each subsequentline with that of the second line.@item -t@itemx --tagged-paragraph@opindex -t@opindex --tagged-paragraph@cindex tagged paragraphs@dfn{Tagged paragraph} mode: like crown margin mode, except that ifindentation of the first line of a paragraph is the same as theindentation of the second, the first line is treated as a one-lineparagraph.@item -s@itemx --split-only@opindex -s@opindex --split-onlySplit lines only.  Do not join short lines to form longer ones.  Thisprevents sample lines of code, and other such ``formatted'' text frombeing unduly combined.@item -u@itemx --uniform-spacing@opindex -u@opindex --uniform-spacingUniform spacing.  Reduce spacing between words to one space, and spacingbetween sentences to two spaces.@item -@var{width}@itemx -w @var{width}@itemx --width=@var{width}@opindex -@var{width}@opindex -w@opindex --widthFill output lines up to @var{width} characters (default 75).  @command{fmt}initially tries to make lines about 7% shorter than this, to give itroom to balance line lengths.@item -p @var{prefix}@itemx --prefix=@var{prefix}Only lines beginning with @var{prefix} (possibly preceded by whitespace)are subject to formatting. The prefix and any preceding whitespace arestripped for the formatting and then re-attached to each formatted outputline.  One use is to format certain kinds of program comments, whileleaving the code unchanged.@end table@node pr invocation@section @command{pr}: Paginate or columnate files for printing@pindex pr@cindex printing, preparing files for@cindex multicolumn output, generating@cindex merging files in parallel@command{pr} writes each @var{file} (@samp{-} means standard input), orstandard input if none are given, to standard output, paginating andoptionally outputting in multicolumn format; optionally merges all@var{file}s, printing all in parallel, one per column.  Synopsis:@examplepr [@var{option}]@dots{} [@var{file}]@dots{}@end example@vindex LC_MESSAGESBy default, a 5-line header is printed at each page: two blank lines;a line with the date, the filename, and the page count; and two moreblank lines.  A footer of five blank lines is also printed.With the @option{-F}option, a 3-line header is printed: the leading two blank lines areomitted; no footer is used.  The default @var{page_length} in both cases is 66lines.  The default number of text lines changes from 56 (without @option{-F})to 63 (with @option{-F}).  The text line of the header takes the form@samp{@var{date} @var{string} @var{page}}, with spaces inserted around@var{string} so that the line takes up the full @var{page_width}.  Here,@var{date} is the date (see the @option{-D} or @option{--date-format}option for details), @var{string} is the centered header string, and@var{page} identifies the page number.  The @env{LC_MESSAGES} localecategory affects the spelling of @var{page}; in the default C locale, itis @samp{Page @var{number}} where @var{number} is the decimal pagenumber.Form feeds in the input cause page breaks in the output.  Multiple formfeeds produce empty pages.Columns are of equal width, separated by an optional string (defaultis @samp{space}).  For multicolumn output, lines will always be truncated to@var{page_width} (default 72), unless you use the @option{-J} option.For singlecolumn output no line truncation occurs by default.  Use @option{-W} option totruncate lines in that case.The following changes were made in version 1.22i and apply to laterversions of @command{pr}:@c FIXME: this whole section here sounds very awkward to me. I@c made a few small changes, but really it all needs to be redone. - Brian@c OK, I fixed another sentence or two, but some of it I just don't understand.@ - Brian@itemize @bullet@itemSome small @var{letter options} (@option{-s}, @option{-w}) have beenredefined for better @acronym{POSIX} compliance.  The output of some furthercases has been adapted to other Unix systems.  These changes are notcompatible with earlier versions of the program.@itemSome @var{new capital letter} options (@option{-J}, @option{-S}, @option{-W})have been introduced to turn off unexpected interferences of small letteroptions.  The @option{-N} option and the second argument @var{last_page}of @samp{+FIRST_PAGE} offer more flexibility.  The detailed handling ofform feeds set in the input files requires the @option{-T} option.@itemCapital letter options override small letter ones.@itemSome of the option-arguments (compare @option{-s}, @option{-e},@option{-i}, @option{-n}) cannot be specified as separate arguments from thepreceding option letter (already stated in the @acronym{POSIX} specification).@end itemizeThe program accepts the following options.  Also see @ref{Common options}.@table @samp@item +@var{first_page}[:@var{last_page}]@itemx --pages=@var{first_page}[:@var{last_page}]@c The two following @opindex lines evoke warnings because they contain `:'@c The `info' spec does not permit that.  If we use those lines, we end@c up with truncated index entries that don't work.@c @opindex +@var{first_page}[:@var{last_page}]@c @opindex --pages=@var{first_page}[:@var{last_page}]@opindex +@var{page_range}@opindex --pages=@var{page_range}Begin printing with page @var{first_page} and stop with @var{last_page}.Missing @samp{:@var{last_page}} implies end of file.  While estimatingthe number of skipped pages each form feed in the input file resultsin a new page.  Page counting with and without @samp{+@var{first_page}}is identical.  By default, counting starts with the first page of inputfile (not first page printed).  Line numbering may be altered by @option{-N}option.@item -@var{column}@itemx --columns=@var{column}@opindex -@var{column}@opindex --columns@cindex down columnsWith each single @var{file}, produce @var{column} columns of output(default is 1) and print columns down, unless @option{-a} is used.  Thecolumn width is automatically decreased as @var{column} increases; unlessyou use the @option{-W/-w} option to increase @var{page_width} as well.This option might well cause some lines to be truncated.  The number oflines in the columns on each page are balanced.  The options @option{-e}and @option{-i} are on for multiple text-column output.  Together with@option{-J} option column alignment and line truncation is turned off.Lines of full length are joined in a free field format and @option{-S}option may set field separators.  @option{-@var{column}} may not be usedwith @option{-m} option.@item -a@itemx --across@opindex -a@opindex --across@cindex across columnsWith each single @var{file}, print columns across rather than down.  The@option{-@var{column}} option must be given with @var{column} greater than one.If a line is too long to fit in a column, it is truncated.@item -c@itemx --show-control-chars@opindex -c@opindex --show-control-charsPrint control characters using hat notation (e.g., @samp{^G}); printother nonprinting characters in octal backslash notation.  By default,nonprinting characters are not changed.@item -d@itemx --double-space@opindex -d@opindex --double-space@cindex double spacingDouble space the output.@item -D @var{format}@itemx --date-format=@var{format}@cindex time formats@cindex formatting timesFormat header dates using @var{format}, using the same conventions asfor the the command @samp{date +@var{format}}; @xref{date invocation}.Except for directives, which start with@samp{%}, characters in @var{format} are printed unchanged.  You can usethis option to specify an arbitrary string in place of the header date,e.g., @option{--date-format="Monday morning"}.@vindex POSIXLY_CORRECT@vindex LC_TIMEIf the @env{POSIXLY_CORRECT} environment variable is not set, the dateformat defaults to @samp{%Y-%m-%d %H:%M} (for example, @samp{2001-12-0423:59}); otherwise, the format depends on the @env{LC_TIME} localecategory, with the default being @samp{%b %e %H:%M %Y} (for example,@samp{Dec@ @ 4 23:59 2001}.@item -e[@var{in-tabchar}[@var{in-tabwidth}]]@itemx --expand-tabs[=@var{in-tabchar}[@var{in-tabwidth}]]@opindex -e@opindex --expand-tabs@cindex input tabsExpand @var{tab}s to spaces on input.  Optional argument @var{in-tabchar} isthe input tab character (default is the TAB character).  Second optionalargument @var{in-tabwidth} is the input tab character's width (defaultis 8).@item -f@itemx -F@itemx --form-feed@opindex -F@opindex -f@opindex --form-feedUse a form feed instead of newlines to separate output pages.  The defaultpage length of 66 lines is not altered.  But the number of lines of textper page changes from default 56 to 63 lines.@item -h @var{HEADER}@itemx --header=@var{HEADER}@opindex -h@opindex --headerReplace the filename in the header with the centered string @var{header}.When using the shell, @var{header} should be quoted and should beseparated from @option{-h} by a space.@item -i[@var{out-tabchar}[@var{out-tabwidth}]]@itemx --output-tabs[=@var{out-tabchar}[@var{out-tabwidth}]]@opindex -i@opindex --output-tabs@cindex output tabsReplace spaces with @var{tab}s on output.  Optional argument @var{out-tabchar}is the output tab character (default is the TAB character).  Second optionalargument @var{out-tabwidth} is the output tab character's width (defaultis 8).@item -J@itemx --join-lines@opindex -J@opindex --join-linesMerge lines of full length.  Used together with the column options@option{-@var{column}}, @option{-a -@var{column}} or @option{-m}.  Turns off@option{-W/-w} line truncation;no column alignment used; may be used with@option{--sep-string[=@var{string}]}.  @option{-J} has been introduced(together with @option{-W} and @option{--sep-string})to disentangle the old (@acronym{POSIX}-compliant) options @option{-w} and@option{-s} along with the three column options.@item -l @var{page_length}@itemx --length=@var{page_length}@opindex -l@opindex --lengthSet the page length to @var{page_length} (default 66) lines, includingthe lines of the header [and the footer].  If @var{page_length} is lessthan or equal to 10 (or <= 3 with @option{-F}), the header and footer areomitted, and all form feeds set in input files are eliminated, as ifthe @option{-T} option had been given.@item -m@itemx --merge@opindex -m@opindex --mergeMerge and print all @va

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -