📄 coreutils.texi
字号:
line numbers or logical pages between files.@cindex headers, numbering@cindex body, numbering@cindex footers, numberingA logical page consists of three sections: header, body, and footer.Any of the sections can be empty. Each can be numbered in a differentstyle from the others.The beginnings of the sections of logical pages are indicated in theinput file by a line containing exactly one of these delimiter strings:@table @samp@item \:\:\:start of header;@item \:\:start of body;@item \:start of footer.@end tableThe two characters from which these strings are made can be changed from@samp{\} and @samp{:} via options (see below), but the pattern andlength of each string cannot be changed.A section delimiter is replaced by an empty line on output. Any textthat comes before the first section delimiter string in the input fileis considered to be part of a body section, so @command{nl} treats afile that contains no section delimiters as a single body section.The program accepts the following options. Also see @ref{Common options}.@table @samp@item -b @var{style}@itemx --body-numbering=@var{style}@opindex -b@opindex --body-numberingSelect the numbering style for lines in the body section of eachlogical page. When a line is not numbered, the current line numberis not incremented, but the line number separator character is stillprepended to the line. The styles are:@table @samp@item anumber all lines,@item tnumber only nonempty lines (default for body),@item ndo not number lines (default for header and footer),@item p@var{regexp}number only lines that contain a match for @var{regexp}.@end table@item -d @var{cd}@itemx --section-delimiter=@var{cd}@opindex -d@opindex --section-delimiter@cindex section delimiters of pagesSet the section delimiter characters to @var{cd}; default is@samp{\:}. If only @var{c} is given, the second remains @samp{:}.(Remember to protect @samp{\} or other metacharacters from shellexpansion with quotes or extra backslashes.)@item -f @var{style}@itemx --footer-numbering=@var{style}@opindex -f@opindex --footer-numberingAnalogous to @option{--body-numbering}.@item -h @var{style}@itemx --header-numbering=@var{style}@opindex -h@opindex --header-numberingAnalogous to @option{--body-numbering}.@item -i @var{number}@itemx --page-increment=@var{number}@opindex -i@opindex --page-incrementIncrement line numbers by @var{number} (default 1).@item -l @var{number}@itemx --join-blank-lines=@var{number}@opindex -l@opindex --join-blank-lines@cindex empty lines, numbering@cindex blank lines, numberingConsider @var{number} (default 1) consecutive empty lines to be onelogical line for numbering, and only number the last one. Where fewerthan @var{number} consecutive empty lines occur, do not number them.An empty line is one that contains no characters, not even spacesor tabs.@item -n @var{format}@itemx --number-format=@var{format}@opindex -n@opindex --number-formatSelect the line numbering format (default is @code{rn}):@table @samp@item ln@opindex ln @r{format for @command{nl}}left justified, no leading zeros;@item rn@opindex rn @r{format for @command{nl}}right justified, no leading zeros;@item rz@opindex rz @r{format for @command{nl}}right justified, leading zeros.@end table@item -p@itemx --no-renumber@opindex -p@opindex --no-renumberDo not reset the line number at the start of a logical page.@item -s @var{string}@itemx --number-separator=@var{string}@opindex -s@opindex --number-separatorSeparate the line number from the text line in the output with@var{string} (default is the TAB character).@item -v @var{number}@itemx --starting-line-number=@var{number}@opindex -v@opindex --starting-line-numberSet the initial line number on each logical page to @var{number} (default 1).@item -w @var{number}@itemx --number-width=@var{number}@opindex -w@opindex --number-widthUse @var{number} characters for line numbers (default 6).@end table@node od invocation@section @command{od}: Write files in octal or other formats@pindex od@cindex octal dump of files@cindex hex dump of files@cindex ASCII dump of files@cindex file contents, dumping unambiguously@command{od} writes an unambiguous representation of each @var{file}(@samp{-} means standard input), or standard input if none are given.Synopses:@exampleod [@var{option}]@dots{} [@var{file}]@dots{}od --traditional [@var{file}] [[+]@var{offset} [[+]@var{label}]]@end exampleEach line of output consists of the offset in the input, followed bygroups of data from the file. By default, @command{od} prints the offset inoctal, and each group of file data is two bytes of input printed as asingle octal number.The program accepts the following options. Also see @ref{Common options}.@table @samp@item -A @var{radix}@itemx --address-radix=@var{radix}@opindex -A@opindex --address-radix@cindex radix for file offsets@cindex file offset radixSelect the base in which file offsets are printed. @var{radix} canbe one of the following:@table @samp@item ddecimal;@item ooctal;@item xhexadecimal;@item nnone (do not print offsets).@end tableThe default is octal.@item -j @var{bytes}@itemx --skip-bytes=@var{bytes}@opindex -j@opindex --skip-bytesSkip @var{bytes} input bytes before formatting and writing. If@var{bytes} begins with @samp{0x} or @samp{0X}, it is interpreted inhexadecimal; otherwise, if it begins with @samp{0}, in octal; otherwise,in decimal. Appending @samp{b} multiplies @var{bytes} by 512, @samp{k}by 1024, and @samp{m} by 1048576.@item -N @var{bytes}@itemx --read-bytes=@var{bytes}@opindex -N@opindex --read-bytesOutput at most @var{bytes} bytes of the input. Prefixes and suffixes on@code{bytes} are interpreted as for the @option{-j} option.@item -s @var{n}@itemx --strings[=@var{n}]@opindex -s@opindex --strings@cindex string constants, outputtingInstead of the normal output, output only @dfn{string constants}: atleast @var{n} consecutive @acronym{ASCII} graphic characters,followed by a null (zero) byte.If @var{n} is omitted with @option{--strings}, the default is 3. Onolder systems, @sc{gnu} @command{od} instead supports an obsoleteoption @option{-s[@var{n}]}, where @var{n} also defaults to 3.@acronym{POSIX} 1003.1-2001 (@pxref{Standards conformance}) does not allow@option{-s} without an argument; use @option{--strings} instead.@item -t @var{type}@itemx --format=@var{type}@opindex -t@opindex --formatSelect the format in which to output the file data. @var{type} is astring of one or more of the below type indicator characters. If youinclude more than one type indicator character in a single @var{type}string, or use this option more than once, @command{od} writes one copyof each output line using each of the data types that you specified,in the order that you specified.Adding a trailing ``z'' to any type specification appends a displayof the @acronym{ASCII} character representation of the printable charactersto the output line generated by the type specification.@table @samp@item anamed character@item c@acronym{ASCII} character or backslash escape,@item dsigned decimal@item ffloating point@item ooctal@item uunsigned decimal@item xhexadecimal@end tableThe type @code{a} outputs things like @samp{sp} for space, @samp{nl} fornewline, and @samp{nul} for a null (zero) byte. Type @code{c} outputs@samp{ }, @samp{\n}, and @code{\0}, respectively.@cindex type sizeExcept for types @samp{a} and @samp{c}, you can specify the numberof bytes to use in interpreting each number in the given data typeby following the type indicator character with a decimal integer.Alternately, you can specify the size of one of the C compiler'sbuilt-in data types by following the type indicator character withone of the following characters. For integers (@samp{d}, @samp{o},@samp{u}, @samp{x}):@table @samp@item Cchar@item Sshort@item Iint@item Llong@end tableFor floating point (@code{f}):@table @asis@item Ffloat@item Ddouble@item Llong double@end table@item -v@itemx --output-duplicates@opindex -v@opindex --output-duplicatesOutput consecutive lines that are identical. By default, when two ormore consecutive output lines would be identical, @command{od} outputs onlythe first line, and puts just an asterisk on the following line toindicate the elision.@item -w @var{n}@itemx --width[=@var{n}]@opindex -w@opindex --widthDump @code{n} input bytes per output line. This must be a multiple ofthe least common multiple of the sizes associated with the specifiedoutput types.If this option is not given at all, the default is 16. If @var{n} isomitted with @option{--width}, the default is 32. On older systems,@sc{gnu} @command{od} instead supports an obsolete option@option{-w[@var{n}]}, where @var{n} also defaults to 32. @acronym{POSIX}1003.1-2001 (@pxref{Standards conformance}) does not allow @option{-w}without an argument; use @option{--width} instead.@end tableThe next several options are shorthands for format specifications.@sc{gnu} @command{od} accepts any combination of shorthands and formatspecification options. These options accumulate.@table @samp@item -a@opindex -aOutput as named characters. Equivalent to @option{-ta}.@item -b@opindex -bOutput as octal bytes. Equivalent to @option{-toC}.@item -c@opindex -cOutput as @acronym{ASCII} characters or backslash escapes. Equivalent to@option{-tc}.@item -d@opindex -dOutput as unsigned decimal shorts. Equivalent to @option{-tu2}.@item -f@opindex -fOutput as floats. Equivalent to @option{-tfF}.@item -h@opindex -hOutput as hexadecimal shorts. Equivalent to @option{-tx2}.@item -i@opindex -iOutput as decimal shorts. Equivalent to @option{-td2}.@item -l@opindex -lOutput as decimal longs. Equivalent to @option{-td4}.@item -o@opindex -oOutput as octal shorts. Equivalent to @option{-to2}.@item -x@opindex -xOutput as hexadecimal shorts. Equivalent to @option{-tx2}.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -