1 This is coreutils.info, produced by makeinfo version 4.8 from
4 INFO-DIR-SECTION Basics
6 * Coreutils: (coreutils). Core GNU (file, text, shell) utilities.
7 * Common options: (coreutils)Common options. Common options.
8 * File permissions: (coreutils)File permissions. Access modes.
9 * Date input formats: (coreutils)Date input formats.
12 INFO-DIR-SECTION Individual utilities
14 * base64: (coreutils)base64 invocation. Base64 encode/decode data.
15 * basename: (coreutils)basename invocation. Strip directory and suffix.
16 * cat: (coreutils)cat invocation. Concatenate and write files.
17 * chgrp: (coreutils)chgrp invocation. Change file groups.
18 * chmod: (coreutils)chmod invocation. Change file permissions.
19 * chown: (coreutils)chown invocation. Change file owners/groups.
20 * chroot: (coreutils)chroot invocation. Specify the root directory.
21 * cksum: (coreutils)cksum invocation. Print POSIX CRC checksum.
22 * comm: (coreutils)comm invocation. Compare sorted files by line.
23 * cp: (coreutils)cp invocation. Copy files.
24 * csplit: (coreutils)csplit invocation. Split by context.
25 * cut: (coreutils)cut invocation. Print selected parts of lines.
26 * date: (coreutils)date invocation. Print/set system date and time.
27 * dd: (coreutils)dd invocation. Copy and convert a file.
28 * df: (coreutils)df invocation. Report file system disk usage.
29 * dir: (coreutils)dir invocation. List directories briefly.
30 * dircolors: (coreutils)dircolors invocation. Color setup for ls.
31 * dirname: (coreutils)dirname invocation. Strip non-directory suffix.
32 * du: (coreutils)du invocation. Report on disk usage.
33 * echo: (coreutils)echo invocation. Print a line of text.
34 * env: (coreutils)env invocation. Modify the environment.
35 * expand: (coreutils)expand invocation. Convert tabs to spaces.
36 * expr: (coreutils)expr invocation. Evaluate expressions.
37 * factor: (coreutils)factor invocation. Print prime factors
38 * false: (coreutils)false invocation. Do nothing, unsuccessfully.
39 * fmt: (coreutils)fmt invocation. Reformat paragraph text.
40 * fold: (coreutils)fold invocation. Wrap long input lines.
41 * groups: (coreutils)groups invocation. Print group names a user is in.
42 * head: (coreutils)head invocation. Output the first part of files.
43 * hostid: (coreutils)hostid invocation. Print numeric host identifier.
44 * hostname: (coreutils)hostname invocation. Print or set system name.
45 * id: (coreutils)id invocation. Print user identity.
46 * install: (coreutils)install invocation. Copy and change attributes.
47 * join: (coreutils)join invocation. Join lines on a common field.
48 * kill: (coreutils)kill invocation. Send a signal to processes.
49 * link: (coreutils)link invocation. Make hard links between files.
50 * ln: (coreutils)ln invocation. Make links between files.
51 * logname: (coreutils)logname invocation. Print current login name.
52 * ls: (coreutils)ls invocation. List directory contents.
53 * md5sum: (coreutils)md5sum invocation. Print or check MD5 digests.
54 * mkdir: (coreutils)mkdir invocation. Create directories.
55 * mkfifo: (coreutils)mkfifo invocation. Create FIFOs (named pipes).
56 * mknod: (coreutils)mknod invocation. Create special files.
57 * mv: (coreutils)mv invocation. Rename files.
58 * nice: (coreutils)nice invocation. Modify niceness.
59 * nl: (coreutils)nl invocation. Number lines and write files.
60 * nohup: (coreutils)nohup invocation. Immunize to hangups.
61 * od: (coreutils)od invocation. Dump files in octal, etc.
62 * paste: (coreutils)paste invocation. Merge lines of files.
63 * pathchk: (coreutils)pathchk invocation. Check file name portability.
64 * pr: (coreutils)pr invocation. Paginate or columnate files.
65 * printenv: (coreutils)printenv invocation. Print environment variables.
66 * printf: (coreutils)printf invocation. Format and print data.
67 * ptx: (coreutils)ptx invocation. Produce permuted indexes.
68 * pwd: (coreutils)pwd invocation. Print working directory.
69 * readlink: (coreutils)readlink invocation. Print referent of a symlink.
70 * rm: (coreutils)rm invocation. Remove files.
71 * rmdir: (coreutils)rmdir invocation. Remove empty directories.
72 * seq: (coreutils)seq invocation. Print numeric sequences
73 * sha1sum: (coreutils)sha1sum invocation. Print or check SHA-1 digests.
74 * sha2: (coreutils)sha2 utilities. Print or check SHA-2 digests.
75 * shred: (coreutils)shred invocation. Remove files more securely.
76 * shuf: (coreutils)shuf invocation. Shuffling text files.
77 * sleep: (coreutils)sleep invocation. Delay for a specified time.
78 * sort: (coreutils)sort invocation. Sort text files.
79 * split: (coreutils)split invocation. Split into fixed-size pieces.
80 * stat: (coreutils)stat invocation. Report file(system) status.
81 * stty: (coreutils)stty invocation. Print/change terminal settings.
82 * su: (coreutils)su invocation. Modify user and group ID.
83 * sum: (coreutils)sum invocation. Print traditional checksum.
84 * sync: (coreutils)sync invocation. Synchronize memory and disk.
85 * tac: (coreutils)tac invocation. Reverse files.
86 * tail: (coreutils)tail invocation. Output the last part of files.
87 * tee: (coreutils)tee invocation. Redirect to multiple files.
88 * test: (coreutils)test invocation. File/string tests.
89 * touch: (coreutils)touch invocation. Change file timestamps.
90 * tr: (coreutils)tr invocation. Translate characters.
91 * true: (coreutils)true invocation. Do nothing, successfully.
92 * tsort: (coreutils)tsort invocation. Topological sort.
93 * tty: (coreutils)tty invocation. Print terminal name.
94 * uname: (coreutils)uname invocation. Print system information.
95 * unexpand: (coreutils)unexpand invocation. Convert spaces to tabs.
96 * uniq: (coreutils)uniq invocation. Uniquify files.
97 * unlink: (coreutils)unlink invocation. Removal via unlink(2).
98 * users: (coreutils)users invocation. Print current user names.
99 * vdir: (coreutils)vdir invocation. List directories verbosely.
100 * wc: (coreutils)wc invocation. Line, word, and byte counts.
101 * who: (coreutils)who invocation. Print who is logged in.
102 * whoami: (coreutils)whoami invocation. Print effective user ID.
103 * yes: (coreutils)yes invocation. Print a string indefinitely.
106 This manual documents version 6.9 of the GNU core utilities,
107 including the standard programs for text and file manipulation.
109 Copyright (C) 1994, 1995, 1996, 2000, 2001, 2002, 2003, 2004, 2005,
110 2006 Free Software Foundation, Inc.
112 Permission is granted to copy, distribute and/or modify this
113 document under the terms of the GNU Free Documentation License,
114 Version 1.2 or any later version published by the Free Software
115 Foundation; with no Invariant Sections, with no Front-Cover Texts,
116 and with no Back-Cover Texts. A copy of the license is included
117 in the section entitled "GNU Free Documentation License".
120 File: coreutils.info, Node: Top, Next: Introduction, Up: (dir)
125 This manual documents version 6.9 of the GNU core utilities, including
126 the standard programs for text and file manipulation.
128 Copyright (C) 1994, 1995, 1996, 2000, 2001, 2002, 2003, 2004, 2005,
129 2006 Free Software Foundation, Inc.
131 Permission is granted to copy, distribute and/or modify this
132 document under the terms of the GNU Free Documentation License,
133 Version 1.2 or any later version published by the Free Software
134 Foundation; with no Invariant Sections, with no Front-Cover Texts,
135 and with no Back-Cover Texts. A copy of the license is included
136 in the section entitled "GNU Free Documentation License".
140 * Introduction:: Caveats, overview, and authors.
141 * Common options:: Common options.
142 * Output of entire files:: cat tac nl od
143 * Formatting file contents:: fmt pr fold
144 * Output of parts of files:: head tail split csplit
145 * Summarizing files:: wc sum cksum md5sum sha1sum sha2
146 * Operating on sorted files:: sort shuf uniq comm ptx tsort
147 * Operating on fields within a line:: cut paste join
148 * Operating on characters:: tr expand unexpand
149 * Directory listing:: ls dir vdir dircolors
150 * Basic operations:: cp dd install mv rm shred
151 * Special file types:: ln mkdir rmdir mkfifo mknod
152 * Changing file attributes:: chgrp chmod chown touch
153 * Disk usage:: df du stat sync
154 * Printing text:: echo printf yes
155 * Conditions:: false true test expr
157 * File name manipulation:: dirname basename pathchk
158 * Working context:: pwd stty printenv tty
159 * User information:: id logname whoami groups users who
160 * System context:: date uname hostname hostid
161 * Modified command invocation:: chroot env nice nohup su
162 * Process control:: kill
164 * Numeric operations:: factor seq
165 * File permissions:: Access modes.
166 * Date input formats:: Specifying date strings.
167 * Opening the software toolbox:: The software tools philosophy.
168 * Copying This Manual:: License for copying this manual.
169 * Index:: General index.
171 --- The Detailed Node Listing ---
175 * Exit status:: Indicating program success or failure.
176 * Backup options:: Backup options
177 * Block size:: Block size
178 * Disambiguating names and IDs:: chgrp and chown owner and group syntax
179 * Random sources:: Sources of random data
180 * Target directory:: Target directory
181 * Trailing slashes:: Trailing slashes
182 * Traversing symlinks:: Traversing symlinks to directories
183 * Treating / specially:: Treating / specially
184 * Standards conformance:: Standards conformance
186 Output of entire files
188 * cat invocation:: Concatenate and write files.
189 * tac invocation:: Concatenate and write files in reverse.
190 * nl invocation:: Number lines and write files.
191 * od invocation:: Write files in octal or other formats.
192 * base64 invocation:: Transform data into printable data.
194 Formatting file contents
196 * fmt invocation:: Reformat paragraph text.
197 * pr invocation:: Paginate or columnate files for printing.
198 * fold invocation:: Wrap input lines to fit in specified width.
200 Output of parts of files
202 * head invocation:: Output the first part of files.
203 * tail invocation:: Output the last part of files.
204 * split invocation:: Split a file into fixed-size pieces.
205 * csplit invocation:: Split a file into context-determined pieces.
209 * wc invocation:: Print newline, word, and byte counts.
210 * sum invocation:: Print checksum and block counts.
211 * cksum invocation:: Print CRC checksum and byte counts.
212 * md5sum invocation:: Print or check MD5 digests.
213 * sha1sum invocation:: Print or check SHA-1 digests.
214 * sha2 utilities:: Print or check SHA-2 digests.
216 Operating on sorted files
218 * sort invocation:: Sort text files.
219 * shuf invocation:: Shuffle text files.
220 * uniq invocation:: Uniquify files.
221 * comm invocation:: Compare two sorted files line by line.
222 * ptx invocation:: Produce a permuted index of file contents.
223 * tsort invocation:: Topological sort.
225 `ptx': Produce permuted indexes
227 * General options in ptx:: Options which affect general program behavior.
228 * Charset selection in ptx:: Underlying character set considerations.
229 * Input processing in ptx:: Input fields, contexts, and keyword selection.
230 * Output formatting in ptx:: Types of output format, and sizing the fields.
231 * Compatibility in ptx:: The GNU extensions to `ptx'
233 Operating on fields within a line
235 * cut invocation:: Print selected parts of lines.
236 * paste invocation:: Merge lines of files.
237 * join invocation:: Join lines on a common field.
239 Operating on characters
241 * tr invocation:: Translate, squeeze, and/or delete characters.
242 * expand invocation:: Convert tabs to spaces.
243 * unexpand invocation:: Convert spaces to tabs.
245 `tr': Translate, squeeze, and/or delete characters
247 * Character sets:: Specifying sets of characters.
248 * Translating:: Changing one set of characters to another.
249 * Squeezing:: Squeezing repeats and deleting.
253 * ls invocation:: List directory contents
254 * dir invocation:: Briefly list directory contents
255 * vdir invocation:: Verbosely list directory contents
256 * dircolors invocation:: Color setup for `ls'
258 `ls': List directory contents
260 * Which files are listed:: Which files are listed
261 * What information is listed:: What information is listed
262 * Sorting the output:: Sorting the output
263 * More details about version sort:: More details about version sort
264 * General output formatting:: General output formatting
265 * Formatting the file names:: Formatting the file names
269 * cp invocation:: Copy files and directories
270 * dd invocation:: Convert and copy a file
271 * install invocation:: Copy files and set attributes
272 * mv invocation:: Move (rename) files
273 * rm invocation:: Remove files or directories
274 * shred invocation:: Remove files more securely
278 * link invocation:: Make a hard link via the link syscall
279 * ln invocation:: Make links between files
280 * mkdir invocation:: Make directories
281 * mkfifo invocation:: Make FIFOs (named pipes)
282 * mknod invocation:: Make block or character special files
283 * readlink invocation:: Print the referent of a symbolic link
284 * rmdir invocation:: Remove empty directories
285 * unlink invocation:: Remove files via unlink syscall
287 Changing file attributes
289 * chown invocation:: Change file owner and group
290 * chgrp invocation:: Change group ownership
291 * chmod invocation:: Change access permissions
292 * touch invocation:: Change file timestamps
296 * df invocation:: Report file system disk space usage
297 * du invocation:: Estimate file space usage
298 * stat invocation:: Report file or file system status
299 * sync invocation:: Synchronize data on disk with memory
303 * echo invocation:: Print a line of text
304 * printf invocation:: Format and print data
305 * yes invocation:: Print a string until interrupted
309 * false invocation:: Do nothing, unsuccessfully
310 * true invocation:: Do nothing, successfully
311 * test invocation:: Check file types and compare values
312 * expr invocation:: Evaluate expressions
314 `test': Check file types and compare values
316 * File type tests:: File type tests
317 * Access permission tests:: Access permission tests
318 * File characteristic tests:: File characteristic tests
319 * String tests:: String tests
320 * Numeric tests:: Numeric tests
322 `expr': Evaluate expression
324 * String expressions:: + : match substr index length
325 * Numeric expressions:: + - * / %
326 * Relations for expr:: | & < <= = == != >= >
327 * Examples of expr:: Examples of using `expr'
331 * tee invocation:: Redirect output to multiple files
333 File name manipulation
335 * basename invocation:: Strip directory and suffix from a file name
336 * dirname invocation:: Strip non-directory suffix from a file name
337 * pathchk invocation:: Check file name portability
341 * pwd invocation:: Print working directory
342 * stty invocation:: Print or change terminal characteristics
343 * printenv invocation:: Print all or some environment variables
344 * tty invocation:: Print file name of terminal on standard input
346 `stty': Print or change terminal characteristics
348 * Control:: Control settings
349 * Input:: Input settings
350 * Output:: Output settings
351 * Local:: Local settings
352 * Combination:: Combination settings
353 * Characters:: Special characters
354 * Special:: Special settings
358 * id invocation:: Print user identity
359 * logname invocation:: Print current login name
360 * whoami invocation:: Print effective user ID
361 * groups invocation:: Print group names a user is in
362 * users invocation:: Print login names of users currently logged in
363 * who invocation:: Print who is currently logged in
367 * date invocation:: Print or set system date and time
368 * uname invocation:: Print system information
369 * hostname invocation:: Print or set system name
370 * hostid invocation:: Print numeric host identifier.
372 `date': Print or set system date and time
374 * Time conversion specifiers:: %[HIklMNpPrRsSTXzZ]
375 * Date conversion specifiers:: %[aAbBcCdDeFgGhjmuUVwWxyY]
376 * Literal conversion specifiers:: %[%nt]
377 * Padding and other flags:: Pad with zeros, spaces, etc.
378 * Setting the time:: Changing the system clock.
379 * Options for date:: Instead of the current time.
380 * Examples of date:: Examples.
382 Modified command invocation
384 * chroot invocation:: Run a command with a different root directory
385 * env invocation:: Run a command in a modified environment
386 * nice invocation:: Run a command with modified niceness
387 * nohup invocation:: Run a command immune to hangups
388 * su invocation:: Run a command with substitute user and group ID
392 * kill invocation:: Sending a signal to processes.
396 * sleep invocation:: Delay for a specified time
400 * factor invocation:: Print prime factors
401 * seq invocation:: Print numeric sequences
405 * Mode Structure:: Structure of file mode bits.
406 * Symbolic Modes:: Mnemonic representation of file mode bits.
407 * Numeric Modes:: File mode bits as octal numbers.
408 * Directory Setuid and Setgid:: Set-user-ID and set-group-ID on directories.
412 * General date syntax:: Common rules.
413 * Calendar date items:: 19 Dec 1994.
414 * Time of day items:: 9:20pm.
415 * Time zone items:: EST, PDT, GMT.
416 * Day of week items:: Monday and others.
417 * Relative items in date strings:: next tuesday, 2 years ago.
418 * Pure numbers in date strings:: 19931219, 1440.
419 * Seconds since the Epoch:: @1078100502.
420 * Specifying time zone rules:: TZ="America/New_York", TZ="UTC0".
421 * Authors of get_date:: Bellovin, Eggert, Salz, Berets, et al.
423 Opening the software toolbox
425 * Toolbox introduction:: Toolbox introduction
426 * I/O redirection:: I/O redirection
427 * The who command:: The `who' command
428 * The cut command:: The `cut' command
429 * The sort command:: The `sort' command
430 * The uniq command:: The `uniq' command
431 * Putting the tools together:: Putting the tools together
435 * GNU Free Documentation License:: License for copying this manual.
438 File: coreutils.info, Node: Introduction, Next: Common options, Prev: Top, Up: Top
443 This manual is a work in progress: many sections make no attempt to
444 explain basic concepts in a way suitable for novices. Thus, if you are
445 interested, please get involved in improving this manual. The entire
446 GNU community will benefit.
448 The GNU utilities documented here are mostly compatible with the
449 POSIX standard. Please report bugs to <bug-coreutils@gnu.org>.
450 Remember to include the version number, machine architecture, input
451 files, and any other information needed to reproduce the bug: your
452 input, what you expected, what you got, and why it is wrong. Diffs are
453 welcome, but please include a description of the problem as well, since
454 this is sometimes difficult to infer. *Note Bugs: (gcc)Bugs.
456 This manual was originally derived from the Unix man pages in the
457 distributions, which were written by David MacKenzie and updated by Jim
458 Meyering. What you are reading now is the authoritative documentation
459 for these utilities; the man pages are no longer being maintained. The
460 original `fmt' man page was written by Ross Paterson. Franc,ois Pinard
461 did the initial conversion to Texinfo format. Karl Berry did the
462 indexing, some reorganization, and editing of the results. Brian
463 Youmans of the Free Software Foundation office staff combined the
464 manuals for textutils, fileutils, and sh-utils to produce the present
465 omnibus manual. Richard Stallman contributed his usual invaluable
466 insights to the overall process.
469 File: coreutils.info, Node: Common options, Next: Output of entire files, Prev: Introduction, Up: Top
474 Certain options are available in all of these programs. Rather than
475 writing identical descriptions for each of the programs, they are
476 described here. (In fact, every GNU program accepts (or should accept)
479 Normally options and operands can appear in any order, and programs
480 act as if all the options appear before any operands. For example,
481 `sort -r passwd -t :' acts like `sort -r -t : passwd', since `:' is an
482 option-argument of `-t'. However, if the `POSIXLY_CORRECT' environment
483 variable is set, options must appear before operands, unless otherwise
484 specified for a particular command.
486 A few programs can usefully have trailing operands with leading `-'.
487 With such a program, options must precede operands even if
488 `POSIXLY_CORRECT' is not set, and this fact is noted in the program
489 description. For example, the `env' command's options must appear
490 before its operands, since in some cases the operands specify a command
491 that itself contains options.
493 Some of these programs recognize the `--help' and `--version'
494 options only when one of them is the sole command line argument.
497 Print a usage message listing all available options, then exit
501 Print the version number, then exit successfully.
504 Delimit the option list. Later arguments, if any, are treated as
505 operands even if they begin with `-'. For example, `sort -- -r'
506 reads from the file named `-r'.
509 A single `-' operand is not really an option, though it looks like
510 one. It stands for standard input, or for standard output if that is
511 clear from the context. For example, `sort -' reads from standard
512 input, and is equivalent to plain `sort', and `tee -' writes an extra
513 copy of its input to standard output. Unless otherwise specified, `-'
514 can appear as any operand that requires a file name.
518 * Exit status:: Indicating program success or failure.
519 * Backup options:: -b -S, in some programs.
520 * Block size:: BLOCK_SIZE and --block-size, in some programs.
521 * Disambiguating names and IDs:: chgrp and chown owner and group syntax
522 * Random sources:: --random-source, in some programs.
523 * Target directory:: Specifying a target directory, in some programs.
524 * Trailing slashes:: --strip-trailing-slashes, in some programs.
525 * Traversing symlinks:: -H, -L, or -P, in some programs.
526 * Treating / specially:: --preserve-root and --no-preserve-root.
527 * Special built-in utilities:: `break', `:', `eval', ...
528 * Standards conformance:: Conformance to the POSIX standard.
531 File: coreutils.info, Node: Exit status, Next: Backup options, Up: Common options
536 Nearly every command invocation yields an integral "exit status" that
537 can be used to change how other commands work. For the vast majority
538 of commands, an exit status of zero indicates success. Failure is
539 indicated by a nonzero value--typically `1', though it may differ on
540 unusual platforms as POSIX requires only that it be nonzero.
542 However, some of the programs documented here do produce other exit
543 status values and a few associate different meanings with the values
544 `0' and `1'. Here are some of the exceptions: `chroot', `env', `expr',
545 `nice', `nohup', `printenv', `sort', `su', `test', `tty'.
548 File: coreutils.info, Node: Backup options, Next: Block size, Prev: Exit status, Up: Common options
553 Some GNU programs (at least `cp', `install', `ln', and `mv') optionally
554 make backups of files before writing new versions. These options
555 control the details of these backups. The options are also briefly
556 mentioned in the descriptions of the particular programs.
560 Make a backup of each file that would otherwise be overwritten or
561 removed. Without this option, the original versions are destroyed.
562 Use METHOD to determine the type of backups to make. When this
563 option is used but METHOD is not specified, then the value of the
564 `VERSION_CONTROL' environment variable is used. And if
565 `VERSION_CONTROL' is not set, the default backup type is
568 Note that the short form of this option, `-b' does not accept any
569 argument. Using `-b' is equivalent to using `--backup=existing'.
571 This option corresponds to the Emacs variable `version-control';
572 the values for METHOD are the same as those used in Emacs. This
573 option also accepts more descriptive names. The valid METHODs are
574 (unique abbreviations are accepted):
582 Always make numbered backups.
586 Make numbered backups of files that already have them, simple
587 backups of the others.
591 Always make simple backups. Please note `never' is not to be
592 confused with `none'.
597 Append SUFFIX to each backup file made with `-b'. If this option
598 is not specified, the value of the `SIMPLE_BACKUP_SUFFIX'
599 environment variable is used. And if `SIMPLE_BACKUP_SUFFIX' is not
600 set, the default is `~', just as in Emacs.
604 File: coreutils.info, Node: Block size, Next: Disambiguating names and IDs, Prev: Backup options, Up: Common options
609 Some GNU programs (at least `df', `du', and `ls') display sizes in
610 "blocks". You can adjust the block size and method of display to make
611 sizes easier to read. The block size used for display is independent
612 of any file system block size. Fractional block counts are rounded up
613 to the nearest integer.
615 The default block size is chosen by examining the following
616 environment variables in turn; the first one that is set determines the
620 This specifies the default block size for the `df' command.
621 Similarly, `DU_BLOCK_SIZE' specifies the default for `du' and
622 `LS_BLOCK_SIZE' for `ls'.
625 This specifies the default block size for all three commands, if
626 the above command-specific environment variables are not set.
629 This specifies the default block size for all values that are
630 normally printed as blocks, if neither `BLOCK_SIZE' nor the above
631 command-specific environment variables are set. Unlike the other
632 environment variables, `BLOCKSIZE' does not affect values that are
633 normally printed as byte counts, e.g., the file sizes contained in
637 If neither `COMMAND_BLOCK_SIZE', nor `BLOCK_SIZE', nor `BLOCKSIZE'
638 is set, but this variable is set, the block size defaults to 512.
641 If none of the above environment variables are set, the block size
642 currently defaults to 1024 bytes in most contexts, but this number may
643 change in the future. For `ls' file sizes, the block size defaults to
646 A block size specification can be a positive integer specifying the
647 number of bytes per block, or it can be `human-readable' or `si' to
648 select a human-readable format. Integers may be followed by suffixes
649 that are upward compatible with the SI prefixes
650 (http://www.bipm.fr/enus/3_SI/si-prefixes.html) for decimal multiples
651 and with the IEC 60027-2 prefixes for binary multiples
652 (http://physics.nist.gov/cuu/Units/binary.html).
654 With human-readable formats, output sizes are followed by a size
655 letter such as `M' for megabytes. `BLOCK_SIZE=human-readable' uses
656 powers of 1024; `M' stands for 1,048,576 bytes. `BLOCK_SIZE=si' is
657 similar, but uses powers of 1000 and appends `B'; `MB' stands for
660 A block size specification preceded by `'' causes output sizes to be
661 displayed with thousands separators. The `LC_NUMERIC' locale specifies
662 the thousands separator and grouping. For example, in an American
663 English locale, `--block-size="'1kB"' would cause a size of 1234000
664 bytes to be displayed as `1,234'. In the default C locale, there is no
665 thousands separator so a leading `'' has no effect.
667 An integer block size can be followed by a suffix to specify a
668 multiple of that size. A bare size letter, or one followed by `iB',
669 specifies a multiple using powers of 1024. A size letter followed by
670 `B' specifies powers of 1000 instead. For example, `1M' and `1MiB' are
671 equivalent to `1048576', whereas `1MB' is equivalent to `1000000'.
673 A plain suffix without a preceding integer acts as if `1' were
674 prepended, except that it causes a size indication to be appended to
675 the output. For example, `--block-size="kB"' displays 3000 as `3kB'.
677 The following suffixes are defined. Large sizes like `1Y' may be
678 rejected by your computer due to limitations of its arithmetic.
681 kilobyte: 10^3 = 1000.
686 kibibyte: 2^10 = 1024. `K' is special: the SI prefix is `k' and
687 the IEC 60027-2 prefix is `Ki', but tradition and POSIX use `k' to
691 megabyte: 10^6 = 1,000,000.
695 mebibyte: 2^20 = 1,048,576.
698 gigabyte: 10^9 = 1,000,000,000.
702 gibibyte: 2^30 = 1,073,741,824.
705 terabyte: 10^12 = 1,000,000,000,000.
709 tebibyte: 2^40 = 1,099,511,627,776.
712 petabyte: 10^15 = 1,000,000,000,000,000.
716 pebibyte: 2^50 = 1,125,899,906,842,624.
719 exabyte: 10^18 = 1,000,000,000,000,000,000.
723 exbibyte: 2^60 = 1,152,921,504,606,846,976.
726 zettabyte: 10^21 = 1,000,000,000,000,000,000,000
730 2^70 = 1,180,591,620,717,411,303,424. (`Zi' is a GNU extension to
734 yottabyte: 10^24 = 1,000,000,000,000,000,000,000,000.
738 2^80 = 1,208,925,819,614,629,174,706,176. (`Yi' is a GNU
739 extension to IEC 60027-2.)
741 Block size defaults can be overridden by an explicit
742 `--block-size=SIZE' option. The `-k' option is equivalent to
743 `--block-size=1K', which is the default unless the `POSIXLY_CORRECT'
744 environment variable is set. The `-h' or `--human-readable' option is
745 equivalent to `--block-size=human-readable'. The `--si' option is
746 equivalent to `--block-size=si'.
749 File: coreutils.info, Node: Disambiguating names and IDs, Next: Random sources, Prev: Block size, Up: Common options
751 2.4 chown and chgrp: Disambiguating user names and IDs
752 ======================================================
754 Since the OWNER and GROUP arguments to `chown' and `chgrp' may be
755 specified as names or numeric IDs, there is an apparent ambiguity.
756 What if a user or group _name_ is a string of digits? (1) Should the
757 command interpret it as a user name or as an ID? POSIX requires that
758 `chown' and `chgrp' first attempt to resolve the specified string as a
759 name, and only once that fails, then try to interpret it as an ID.
760 This is troublesome when you want to specify a numeric ID, say 42, and
761 it must work even in a pathological situation where `42' is a user name
762 that maps to some other user ID, say 1000. Simply invoking `chown 42
763 F', will set `F's owner ID to 1000--not what you intended.
765 GNU `chown' and `chgrp' provide a way to work around this, that at
766 the same time may result in a significant performance improvement by
767 eliminating a database look-up. Simply precede each numeric user ID
768 and/or group ID with a `+', in order to force its interpretation as an
772 chgrp +$numeric_group_id another-file
775 GNU `chown' and `chgrp' skip the name look-up process for each
776 `+'-prefixed string, because a string containing `+' is never a valid
777 user or group name. This syntax is accepted on most common Unix
778 systems, but not on Solaris 10.
780 ---------- Footnotes ----------
782 (1) Using a number as a user name is common in some environments.
785 File: coreutils.info, Node: Random sources, Next: Target directory, Prev: Disambiguating names and IDs, Up: Common options
787 2.5 Sources of random data
788 ==========================
790 The `shuf', `shred', and `sort' commands sometimes need random data to
791 do their work. For example, `sort -R' must choose a hash function at
792 random, and it needs random data to make this selection.
794 Normally these commands use the device file `/dev/urandom' as the
795 source of random data. Typically, this device gathers environmental
796 noise from device drivers and other sources into an entropy pool, and
797 uses the pool to generate random bits. If the pool is short of data,
798 the device reuses the internal pool to produce more bits, using a
799 cryptographically secure pseudorandom number generator.
801 `/dev/urandom' suffices for most practical uses, but applications
802 requiring high-value or long-term protection of private data may
803 require an alternate data source like `/dev/random' or `/dev/arandom'.
804 The set of available sources depends on your operating system.
806 To use such a source, specify the `--random-source=FILE' option,
807 e.g., `shuf --random-source=/dev/random'. The contents of FILE should
808 be as random as possible. An error is reported if FILE does not
809 contain enough bytes to randomize the input adequately.
811 To reproduce the results of an earlier invocation of a command, you
812 can save some random data into a file and then use that file as the
813 random source in earlier and later invocations of the command.
815 Some old-fashioned or stripped-down operating systems lack support
816 for `/dev/urandom'. On these systems commands like `shuf' by default
817 fall back on an internal pseudorandom generator initialized by a small
821 File: coreutils.info, Node: Target directory, Next: Trailing slashes, Prev: Random sources, Up: Common options
826 The `cp', `install', `ln', and `mv' commands normally treat the last
827 operand specially when it is a directory or a symbolic link to a
828 directory. For example, `cp source dest' is equivalent to `cp source
829 dest/source' if `dest' is a directory. Sometimes this behavior is not
830 exactly what is wanted, so these commands support the following options
831 to allow more fine-grained control:
834 `--no-target-directory'
835 Do not treat the last operand specially when it is a directory or a
836 symbolic link to a directory. This can help avoid race conditions
837 in programs that operate in a shared area. For example, when the
838 command `mv /tmp/source /tmp/dest' succeeds, there is no guarantee
839 that `/tmp/source' was renamed to `/tmp/dest': it could have been
840 renamed to `/tmp/dest/source' instead, if some other process
841 created `/tmp/dest' as a directory. However, if `mv -T
842 /tmp/source /tmp/dest' succeeds, there is no question that
843 `/tmp/source' was renamed to `/tmp/dest'.
845 In the opposite situation, where you want the last operand to be
846 treated as a directory and want a diagnostic otherwise, you can use
847 the `--target-directory' (`-t') option.
850 `--target-directory=DIRECTORY'
851 Use DIRECTORY as the directory component of each destination file
854 The interface for most programs is that after processing options
855 and a finite (possibly zero) number of fixed-position arguments,
856 the remaining argument list is either expected to be empty, or is
857 a list of items (usually files) that will all be handled
858 identically. The `xargs' program is designed to work well with
861 The commands in the `mv'-family are unusual in that they take a
862 variable number of arguments with a special case at the _end_
863 (namely, the target directory). This makes it nontrivial to
864 perform some operations, e.g., "move all files from here to
865 ../d/", because `mv * ../d/' might exhaust the argument space, and
866 `ls | xargs ...' doesn't have a clean way to specify an extra
867 final argument for each invocation of the subject command. (It
868 can be done by going through a shell command, but that requires
869 more human labor and brain power than it should.)
871 The `--target-directory' (`-t') option allows the `cp', `install',
872 `ln', and `mv' programs to be used conveniently with `xargs'. For
873 example, you can move the files from the current directory to a
874 sibling directory, `d' like this:
876 ls | xargs mv -t ../d --
878 However, this doesn't move files whose names begin with `.'. If
879 you use the GNU `find' program, you can move those files too, with
882 find . -mindepth 1 -maxdepth 1 \
885 But both of the above approaches fail if there are no files in the
886 current directory, or if any file has a name containing a blank or
887 some other special characters. The following example removes
888 those limitations and requires both GNU `find' and GNU `xargs':
890 find . -mindepth 1 -maxdepth 1 -print0 \
891 | xargs --null --no-run-if-empty \
895 The `--target-directory' (`-t') and `--no-target-directory' (`-T')
896 options cannot be combined.
899 File: coreutils.info, Node: Trailing slashes, Next: Traversing symlinks, Prev: Target directory, Up: Common options
904 Some GNU programs (at least `cp' and `mv') allow you to remove any
905 trailing slashes from each SOURCE argument before operating on it. The
906 `--strip-trailing-slashes' option enables this behavior.
908 This is useful when a SOURCE argument may have a trailing slash and
909 specify a symbolic link to a directory. This scenario is in fact rather
910 common because some shells can automatically append a trailing slash
911 when performing file name completion on such symbolic links. Without
912 this option, `mv', for example, (via the system's rename function) must
913 interpret a trailing slash as a request to dereference the symbolic link
914 and so must rename the indirectly referenced _directory_ and not the
915 symbolic link. Although it may seem surprising that such behavior be
916 the default, it is required by POSIX and is consistent with other parts
920 File: coreutils.info, Node: Traversing symlinks, Next: Treating / specially, Prev: Trailing slashes, Up: Common options
922 2.8 Traversing symlinks
923 =======================
925 The following options modify how `chown' and `chgrp' traverse a
926 hierarchy when the `--recursive' (`-R') option is also specified. If
927 more than one of the following options is specified, only the final one
928 takes effect. These options specify whether processing a symbolic link
929 to a directory entails operating on just the symbolic link or on all
930 files in the hierarchy rooted at that directory.
932 These options are independent of `--dereference' and
933 `--no-dereference' (`-h'), which control whether to modify a symlink or
937 If `--recursive' (`-R') is specified and a command line argument
938 is a symbolic link to a directory, traverse it.
941 In a recursive traversal, traverse every symbolic link to a
942 directory that is encountered.
945 Do not traverse any symbolic links. This is the default if none
946 of `-H', `-L', or `-P' is specified.
950 File: coreutils.info, Node: Treating / specially, Next: Special built-in utilities, Prev: Traversing symlinks, Up: Common options
952 2.9 Treating / specially
953 ========================
955 Certain commands can operate destructively on entire hierarchies. For
956 example, if a user with appropriate privileges mistakenly runs `rm -rf
957 / tmp/junk', that may remove all files on the entire system. Since
958 there are so few legitimate uses for such a command, GNU `rm' normally
959 declines to operate on any directory that resolves to `/'. If you
960 really want to try to remove all the files on your system, you can use
961 the `--no-preserve-root' option, but the default behavior, specified by
962 the `--preserve-option', is safer for most purposes.
964 The commands `chgrp', `chmod' and `chown' can also operate
965 destructively on entire hierarchies, so they too support these options.
966 Although, unlike `rm', they don't actually unlink files, these
967 commands are arguably more dangerous when operating recursively on `/',
968 since they often work much more quickly, and hence damage more files
969 before an alert user can interrupt them. Tradition and POSIX require
970 these commands to operate recursively on `/', so they default to
971 `--no-preserve-root', but using the `--preserve-root' option makes them
972 safer for most purposes. For convenience you can specify
973 `--preserve-root' in an alias or in a shell function.
975 Note that the `--preserve-root' option also ensures that `chgrp' and
976 `chown' do not modify `/' even when dereferencing a symlink pointing to
980 File: coreutils.info, Node: Special built-in utilities, Next: Standards conformance, Prev: Treating / specially, Up: Common options
982 2.10 Special built-in utilities
983 ===============================
985 Some programs like `nice' can invoke other programs; for example, the
986 command `nice cat file' invokes the program `cat' by executing the
987 command `cat file'. However, "special built-in utilities" like `exit'
988 cannot be invoked this way. For example, the command `nice exit' does
989 not have a well-defined behavior: it may generate an error message
992 Here is a list of the special built-in utilities that are
993 standardized by POSIX 1003.1-2004.
995 . : break continue eval exec exit export readonly return set shift
998 For example, because `.', `:', and `exec' are special, the commands
999 `nice . foo.sh', `nice :', and `nice exec pwd' do not work as you might
1002 Many shells extend this list. For example, Bash has several extra
1003 special built-in utilities like `history', and `suspend', and with Bash
1004 the command `nice suspend' generates an error message instead of
1008 File: coreutils.info, Node: Standards conformance, Prev: Special built-in utilities, Up: Common options
1010 2.11 Standards conformance
1011 ==========================
1013 In a few cases, the GNU utilities' default behavior is incompatible
1014 with the POSIX standard. To suppress these incompatibilities, define
1015 the `POSIXLY_CORRECT' environment variable. Unless you are checking
1016 for POSIX conformance, you probably do not need to define
1019 Newer versions of POSIX are occasionally incompatible with older
1020 versions. For example, older versions of POSIX required the command
1021 `sort +1' to sort based on the second and succeeding fields in each
1022 input line, but starting with POSIX 1003.1-2001 the same command is
1023 required to sort the file named `+1', and you must instead use the
1024 command `sort -k 2' to get the field-based sort.
1026 The GNU utilities normally conform to the version of POSIX that is
1027 standard for your system. To cause them to conform to a different
1028 version of POSIX, define the `_POSIX2_VERSION' environment variable to
1029 a value of the form YYYYMM specifying the year and month the standard
1030 was adopted. Two values are currently supported for `_POSIX2_VERSION':
1031 `199209' stands for POSIX 1003.2-1992, and `200112' stands for POSIX
1032 1003.1-2001. For example, if you have a newer system but are running
1033 software that assumes an older version of POSIX and uses `sort +1' or
1034 `tail +10', you can work around any compatibility problems by setting
1035 `_POSIX2_VERSION=199209' in your environment.
1038 File: coreutils.info, Node: Output of entire files, Next: Formatting file contents, Prev: Common options, Up: Top
1040 3 Output of entire files
1041 ************************
1043 These commands read and write entire files, possibly transforming them
1048 * cat invocation:: Concatenate and write files.
1049 * tac invocation:: Concatenate and write files in reverse.
1050 * nl invocation:: Number lines and write files.
1051 * od invocation:: Write files in octal or other formats.
1052 * base64 invocation:: Transform data into printable data.
1055 File: coreutils.info, Node: cat invocation, Next: tac invocation, Up: Output of entire files
1057 3.1 `cat': Concatenate and write files
1058 ======================================
1060 `cat' copies each FILE (`-' means standard input), or standard input if
1061 none are given, to standard output. Synopsis:
1063 cat [OPTION] [FILE]...
1065 The program accepts the following options. Also see *Note Common
1070 Equivalent to `-vET'.
1074 Number all nonblank output lines, starting with 1.
1077 Equivalent to `-vE'.
1081 Display a `$' after the end of each line.
1085 Number all output lines, starting with 1.
1089 Replace multiple adjacent blank lines with a single blank line.
1092 Equivalent to `-vT'.
1096 Display TAB characters as `^I'.
1099 Ignored; for POSIX compatibility.
1102 `--show-nonprinting'
1103 Display control characters except for LFD and TAB using `^'
1104 notation and precede characters that have the high bit set with
1108 On systems like MS-DOS that distinguish between text and binary
1109 files, `cat' normally reads and writes in binary mode. However, `cat'
1110 reads in text mode if one of the options `-bensAE' is used or if `cat'
1111 is reading from standard input and standard input is a terminal.
1112 Similarly, `cat' writes in text mode if one of the options `-bensAE' is
1113 used or if standard output is a terminal.
1115 An exit status of zero indicates success, and a nonzero value
1120 # Output f's contents, then standard input, then g's contents.
1123 # Copy standard input to standard output.
1127 File: coreutils.info, Node: tac invocation, Next: nl invocation, Prev: cat invocation, Up: Output of entire files
1129 3.2 `tac': Concatenate and write files in reverse
1130 =================================================
1132 `tac' copies each FILE (`-' means standard input), or standard input if
1133 none are given, to standard output, reversing the records (lines by
1134 default) in each separately. Synopsis:
1136 tac [OPTION]... [FILE]...
1138 "Records" are separated by instances of a string (newline by
1139 default). By default, this separator string is attached to the end of
1140 the record that it follows in the file.
1142 The program accepts the following options. Also see *Note Common
1147 The separator is attached to the beginning of the record that it
1148 precedes in the file.
1152 Treat the separator string as a regular expression. Users of `tac'
1153 on MS-DOS/MS-Windows should note that, since `tac' reads files in
1154 binary mode, each line of a text file might end with a CR/LF pair
1155 instead of the Unix-style LF.
1158 `--separator=SEPARATOR'
1159 Use SEPARATOR as the record separator, instead of newline.
1162 An exit status of zero indicates success, and a nonzero value
1166 File: coreutils.info, Node: nl invocation, Next: od invocation, Prev: tac invocation, Up: Output of entire files
1168 3.3 `nl': Number lines and write files
1169 ======================================
1171 `nl' writes each FILE (`-' means standard input), or standard input if
1172 none are given, to standard output, with line numbers added to some or
1173 all of the lines. Synopsis:
1175 nl [OPTION]... [FILE]...
1177 `nl' decomposes its input into (logical) pages; by default, the line
1178 number is reset to 1 at the top of each logical page. `nl' treats all
1179 of the input files as a single document; it does not reset line numbers
1180 or logical pages between files.
1182 A logical page consists of three sections: header, body, and footer.
1183 Any of the sections can be empty. Each can be numbered in a different
1184 style from the others.
1186 The beginnings of the sections of logical pages are indicated in the
1187 input file by a line containing exactly one of these delimiter strings:
1198 The two characters from which these strings are made can be changed
1199 from `\' and `:' via options (see below), but the pattern and length of
1200 each string cannot be changed.
1202 A section delimiter is replaced by an empty line on output. Any text
1203 that comes before the first section delimiter string in the input file
1204 is considered to be part of a body section, so `nl' treats a file that
1205 contains no section delimiters as a single body section.
1207 The program accepts the following options. Also see *Note Common
1211 `--body-numbering=STYLE'
1212 Select the numbering style for lines in the body section of each
1213 logical page. When a line is not numbered, the current line number
1214 is not incremented, but the line number separator character is
1215 still prepended to the line. The styles are:
1221 number only nonempty lines (default for body),
1224 do not number lines (default for header and footer),
1227 number only lines that contain a match for the basic regular
1228 expression BRE. *Note Regular Expressions: (grep)Regular
1232 `--section-delimiter=CD'
1233 Set the section delimiter characters to CD; default is `\:'. If
1234 only C is given, the second remains `:'. (Remember to protect `\'
1235 or other metacharacters from shell expansion with quotes or extra
1239 `--footer-numbering=STYLE'
1240 Analogous to `--body-numbering'.
1243 `--header-numbering=STYLE'
1244 Analogous to `--body-numbering'.
1247 `--page-increment=NUMBER'
1248 Increment line numbers by NUMBER (default 1).
1251 `--join-blank-lines=NUMBER'
1252 Consider NUMBER (default 1) consecutive empty lines to be one
1253 logical line for numbering, and only number the last one. Where
1254 fewer than NUMBER consecutive empty lines occur, do not number
1255 them. An empty line is one that contains no characters, not even
1259 `--number-format=FORMAT'
1260 Select the line numbering format (default is `rn'):
1263 left justified, no leading zeros;
1266 right justified, no leading zeros;
1269 right justified, leading zeros.
1273 Do not reset the line number at the start of a logical page.
1276 `--number-separator=STRING'
1277 Separate the line number from the text line in the output with
1278 STRING (default is the TAB character).
1281 `--starting-line-number=NUMBER'
1282 Set the initial line number on each logical page to NUMBER
1286 `--number-width=NUMBER'
1287 Use NUMBER characters for line numbers (default 6).
1290 An exit status of zero indicates success, and a nonzero value
1294 File: coreutils.info, Node: od invocation, Next: base64 invocation, Prev: nl invocation, Up: Output of entire files
1296 3.4 `od': Write files in octal or other formats
1297 ===============================================
1299 `od' writes an unambiguous representation of each FILE (`-' means
1300 standard input), or standard input if none are given. Synopses:
1302 od [OPTION]... [FILE]...
1303 od [-abcdfilosx]... [FILE] [[+]OFFSET[.][b]]
1304 od [OPTION]... --traditional [FILE] [[+]OFFSET[.][b] [[+]LABEL[.][b]]]
1306 Each line of output consists of the offset in the input, followed by
1307 groups of data from the file. By default, `od' prints the offset in
1308 octal, and each group of file data is a C `short int''s worth of input
1309 printed as a single octal number.
1311 If OFFSET is given, it specifies how many input bytes to skip before
1312 formatting and writing. By default, it is interpreted as an octal
1313 number, but the optional trailing decimal point causes it to be
1314 interpreted as decimal. If no decimal is specified and the offset
1315 begins with `0x' or `0X' it is interpreted as a hexadecimal number. If
1316 there is a trailing `b', the number of bytes skipped will be OFFSET
1319 If a command is of both the first and second forms, the second form
1320 is assumed if the last operand begins with `+' or (if there are two
1321 operands) a digit. For example, in `od foo 10' and `od +10' the `10'
1322 is an offset, whereas in `od 10' the `10' is a file name.
1324 The program accepts the following options. Also see *Note Common
1328 `--address-radix=RADIX'
1329 Select the base in which file offsets are printed. RADIX can be
1330 one of the following:
1342 none (do not print offsets).
1344 The default is octal.
1347 `--skip-bytes=BYTES'
1348 Skip BYTES input bytes before formatting and writing. If BYTES
1349 begins with `0x' or `0X', it is interpreted in hexadecimal;
1350 otherwise, if it begins with `0', in octal; otherwise, in decimal.
1351 Appending `b' multiplies BYTES by 512, `k' by 1024, and `m' by
1355 `--read-bytes=BYTES'
1356 Output at most BYTES bytes of the input. Prefixes and suffixes on
1357 `bytes' are interpreted as for the `-j' option.
1361 Instead of the normal output, output only "string constants": at
1362 least N consecutive ASCII graphic characters, followed by a null
1365 If N is omitted with `--strings', the default is 3.
1369 Select the format in which to output the file data. TYPE is a
1370 string of one or more of the below type indicator characters. If
1371 you include more than one type indicator character in a single TYPE
1372 string, or use this option more than once, `od' writes one copy of
1373 each output line using each of the data types that you specified,
1374 in the order that you specified.
1376 Adding a trailing "z" to any type specification appends a display
1377 of the ASCII character representation of the printable characters
1378 to the output line generated by the type specification.
1381 named character, ignoring high-order bit
1384 ASCII character or backslash escape,
1401 The type `a' outputs things like `sp' for space, `nl' for newline,
1402 and `nul' for a null (zero) byte. Only the least significant
1403 seven bits of each byte is used; the high-order bit is ignored.
1404 Type `c' outputs ` ', `\n', and `\0', respectively.
1406 Except for types `a' and `c', you can specify the number of bytes
1407 to use in interpreting each number in the given data type by
1408 following the type indicator character with a decimal integer.
1409 Alternately, you can specify the size of one of the C compiler's
1410 built-in data types by following the type indicator character with
1411 one of the following characters. For integers (`d', `o', `u',
1426 For floating point (`f'):
1438 `--output-duplicates'
1439 Output consecutive lines that are identical. By default, when two
1440 or more consecutive output lines would be identical, `od' outputs
1441 only the first line, and puts just an asterisk on the following
1442 line to indicate the elision.
1446 Dump `n' input bytes per output line. This must be a multiple of
1447 the least common multiple of the sizes associated with the
1448 specified output types.
1450 If this option is not given at all, the default is 16. If N is
1451 omitted, the default is 32.
1454 The next several options are shorthands for format specifications.
1455 GNU `od' accepts any combination of shorthands and format specification
1456 options. These options accumulate.
1459 Output as named characters. Equivalent to `-t a'.
1462 Output as octal bytes. Equivalent to `-t o1'.
1465 Output as ASCII characters or backslash escapes. Equivalent to
1469 Output as unsigned decimal two-byte units. Equivalent to `-t u2'.
1472 Output as floats. Equivalent to `-t fF'.
1475 Output as decimal ints. Equivalent to `-t dI'.
1478 Output as decimal long ints. Equivalent to `-t dL'.
1481 Output as octal two-byte units. Equivalent to `-t o2'.
1484 Output as decimal two-byte units. Equivalent to `-t d2'.
1487 Output as hexadecimal two-byte units. Equivalent to `-t x2'.
1490 Recognize the non-option label argument that traditional `od'
1491 accepted. The following syntax:
1493 od --traditional [FILE] [[+]OFFSET[.][b] [[+]LABEL[.][b]]]
1495 can be used to specify at most one file and optional arguments
1496 specifying an offset and a pseudo-start address, LABEL. The LABEL
1497 argument is interpreted just like OFFSET, but it specifies an
1498 initial pseudo-address. The pseudo-addresses are displayed in
1499 parentheses following any normal address.
1502 An exit status of zero indicates success, and a nonzero value
1506 File: coreutils.info, Node: base64 invocation, Prev: od invocation, Up: Output of entire files
1508 3.5 `base64': Transform data into printable data.
1509 =================================================
1511 `base64' transforms data read from a file, or standard input, into (or
1512 from) base64 encoded form. The base64 encoded form uses printable
1513 ASCII characters to represent binary data, see RFC 3548
1514 (ftp://ftp.rfc-editor.org/in-notes/rfc3548.txt). Synopses:
1516 base64 [OPTION]... [FILE]
1517 base64 --decode [OPTION]... [FILE]
1519 The base64 encoding expands data to roughly 133% of the original.
1521 The program accepts the following options. Also see *Note Common
1526 During encoding, wrap lines after COLS characters. This must be a
1529 The default is to wrap after 76 characters. Use the value 0 to
1530 disable line wrapping altogether.
1534 Change the mode of operation, from the default of encoding data, to
1535 decoding data. Input is expected to be base64 encoded data, and
1536 the output will be the original data.
1540 When decoding, newlines are always accepted. During decoding,
1541 ignore unrecognized bytes, to permit distorted data to be decoded.
1544 An exit status of zero indicates success, and a nonzero value
1548 File: coreutils.info, Node: Formatting file contents, Next: Output of parts of files, Prev: Output of entire files, Up: Top
1550 4 Formatting file contents
1551 **************************
1553 These commands reformat the contents of files.
1557 * fmt invocation:: Reformat paragraph text.
1558 * pr invocation:: Paginate or columnate files for printing.
1559 * fold invocation:: Wrap input lines to fit in specified width.
1562 File: coreutils.info, Node: fmt invocation, Next: pr invocation, Up: Formatting file contents
1564 4.1 `fmt': Reformat paragraph text
1565 ==================================
1567 `fmt' fills and joins lines to produce output lines of (at most) a
1568 given number of characters (75 by default). Synopsis:
1570 fmt [OPTION]... [FILE]...
1572 `fmt' reads from the specified FILE arguments (or standard input if
1573 none are given), and writes to standard output.
1575 By default, blank lines, spaces between words, and indentation are
1576 preserved in the output; successive input lines with different
1577 indentation are not joined; tabs are expanded on input and introduced on
1580 `fmt' prefers breaking lines at the end of a sentence, and tries to
1581 avoid line breaks after the first word of a sentence or before the last
1582 word of a sentence. A "sentence break" is defined as either the end of
1583 a paragraph or a word ending in any of `.?!', followed by two spaces or
1584 end of line, ignoring any intervening parentheses or quotes. Like TeX,
1585 `fmt' reads entire "paragraphs" before choosing line breaks; the
1586 algorithm is a variant of that given by Donald E. Knuth and Michael F.
1587 Plass in "Breaking Paragraphs Into Lines", `Software--Practice &
1588 Experience' 11, 11 (November 1981), 1119-1184.
1590 The program accepts the following options. Also see *Note Common
1595 "Crown margin" mode: preserve the indentation of the first two
1596 lines within a paragraph, and align the left margin of each
1597 subsequent line with that of the second line.
1600 `--tagged-paragraph'
1601 "Tagged paragraph" mode: like crown margin mode, except that if
1602 indentation of the first line of a paragraph is the same as the
1603 indentation of the second, the first line is treated as a one-line
1608 Split lines only. Do not join short lines to form longer ones.
1609 This prevents sample lines of code, and other such "formatted"
1610 text from being unduly combined.
1614 Uniform spacing. Reduce spacing between words to one space, and
1615 spacing between sentences to two spaces.
1620 Fill output lines up to WIDTH characters (default 75). `fmt'
1621 initially tries to make lines about 7% shorter than this, to give
1622 it room to balance line lengths.
1626 Only lines beginning with PREFIX (possibly preceded by whitespace)
1627 are subject to formatting. The prefix and any preceding
1628 whitespace are stripped for the formatting and then re-attached to
1629 each formatted output line. One use is to format certain kinds of
1630 program comments, while leaving the code unchanged.
1633 An exit status of zero indicates success, and a nonzero value
1637 File: coreutils.info, Node: pr invocation, Next: fold invocation, Prev: fmt invocation, Up: Formatting file contents
1639 4.2 `pr': Paginate or columnate files for printing
1640 ==================================================
1642 `pr' writes each FILE (`-' means standard input), or standard input if
1643 none are given, to standard output, paginating and optionally
1644 outputting in multicolumn format; optionally merges all FILEs, printing
1645 all in parallel, one per column. Synopsis:
1647 pr [OPTION]... [FILE]...
1649 By default, a 5-line header is printed at each page: two blank lines;
1650 a line with the date, the file name, and the page count; and two more
1651 blank lines. A footer of five blank lines is also printed. With the
1652 `-F' option, a 3-line header is printed: the leading two blank lines are
1653 omitted; no footer is used. The default PAGE_LENGTH in both cases is 66
1654 lines. The default number of text lines changes from 56 (without `-F')
1655 to 63 (with `-F'). The text line of the header takes the form `DATE
1656 STRING PAGE', with spaces inserted around STRING so that the line takes
1657 up the full PAGE_WIDTH. Here, DATE is the date (see the `-D' or
1658 `--date-format' option for details), STRING is the centered header
1659 string, and PAGE identifies the page number. The `LC_MESSAGES' locale
1660 category affects the spelling of PAGE; in the default C locale, it is
1661 `Page NUMBER' where NUMBER is the decimal page number.
1663 Form feeds in the input cause page breaks in the output. Multiple
1664 form feeds produce empty pages.
1666 Columns are of equal width, separated by an optional string (default
1667 is `space'). For multicolumn output, lines will always be truncated to
1668 PAGE_WIDTH (default 72), unless you use the `-J' option. For single
1669 column output no line truncation occurs by default. Use `-W' option to
1670 truncate lines in that case.
1672 The following changes were made in version 1.22i and apply to later
1673 versions of `pr': - Brian
1674 * Some small LETTER OPTIONS (`-s', `-w') have been redefined for
1675 better POSIX compliance. The output of some further cases has
1676 been adapted to other Unix systems. These changes are not
1677 compatible with earlier versions of the program.
1679 * Some NEW CAPITAL LETTER options (`-J', `-S', `-W') have been
1680 introduced to turn off unexpected interferences of small letter
1681 options. The `-N' option and the second argument LAST_PAGE of
1682 `+FIRST_PAGE' offer more flexibility. The detailed handling of
1683 form feeds set in the input files requires the `-T' option.
1685 * Capital letter options override small letter ones.
1687 * Some of the option-arguments (compare `-s', `-e', `-i', `-n')
1688 cannot be specified as separate arguments from the preceding
1689 option letter (already stated in the POSIX specification).
1691 The program accepts the following options. Also see *Note Common
1694 `+FIRST_PAGE[:LAST_PAGE]'
1695 `--pages=FIRST_PAGE[:LAST_PAGE]'
1696 Begin printing with page FIRST_PAGE and stop with LAST_PAGE.
1697 Missing `:LAST_PAGE' implies end of file. While estimating the
1698 number of skipped pages each form feed in the input file results
1699 in a new page. Page counting with and without `+FIRST_PAGE' is
1700 identical. By default, counting starts with the first page of
1701 input file (not first page printed). Line numbering may be
1702 altered by `-N' option.
1706 With each single FILE, produce COLUMN columns of output (default
1707 is 1) and print columns down, unless `-a' is used. The column
1708 width is automatically decreased as COLUMN increases; unless you
1709 use the `-W/-w' option to increase PAGE_WIDTH as well. This
1710 option might well cause some lines to be truncated. The number of
1711 lines in the columns on each page are balanced. The options `-e'
1712 and `-i' are on for multiple text-column output. Together with
1713 `-J' option column alignment and line truncation is turned off.
1714 Lines of full length are joined in a free field format and `-S'
1715 option may set field separators. `-COLUMN' may not be used with
1720 With each single FILE, print columns across rather than down. The
1721 `-COLUMN' option must be given with COLUMN greater than one. If a
1722 line is too long to fit in a column, it is truncated.
1725 `--show-control-chars'
1726 Print control characters using hat notation (e.g., `^G'); print
1727 other nonprinting characters in octal backslash notation. By
1728 default, nonprinting characters are not changed.
1732 Double space the output.
1735 `--date-format=FORMAT'
1736 Format header dates using FORMAT, using the same conventions as
1737 for the command `date +FORMAT'; *Note date invocation::. Except
1738 for directives, which start with `%', characters in FORMAT are
1739 printed unchanged. You can use this option to specify an
1740 arbitrary string in place of the header date, e.g.,
1741 `--date-format="Monday morning"'.
1743 Normally the date format defaults to `%Y-%m-%d %H:%M' (for
1744 example, `2001-12-04 23:59'); but if the `POSIXLY_CORRECT'
1745 environment variable is set and the `LC_TIME' locale category
1746 specifies the POSIX locale, the default is `%b %e %H:%M %Y' (for
1747 example, `Dec 4 23:59 2001'.
1749 Time stamps are listed according to the time zone rules specified
1750 by the `TZ' environment variable, or by the system default rules if
1751 `TZ' is not set. *Note Specifying the Time Zone with `TZ':
1754 `-e[IN-TABCHAR[IN-TABWIDTH]]'
1755 `--expand-tabs[=IN-TABCHAR[IN-TABWIDTH]]'
1756 Expand TABs to spaces on input. Optional argument IN-TABCHAR is
1757 the input tab character (default is the TAB character). Second
1758 optional argument IN-TABWIDTH is the input tab character's width
1764 Use a form feed instead of newlines to separate output pages. The
1765 default page length of 66 lines is not altered. But the number of
1766 lines of text per page changes from default 56 to 63 lines.
1770 Replace the file name in the header with the centered string
1771 HEADER. When using the shell, HEADER should be quoted and should
1772 be separated from `-h' by a space.
1774 `-i[OUT-TABCHAR[OUT-TABWIDTH]]'
1775 `--output-tabs[=OUT-TABCHAR[OUT-TABWIDTH]]'
1776 Replace spaces with TABs on output. Optional argument OUT-TABCHAR
1777 is the output tab character (default is the TAB character).
1778 Second optional argument OUT-TABWIDTH is the output tab
1779 character's width (default is 8).
1783 Merge lines of full length. Used together with the column options
1784 `-COLUMN', `-a -COLUMN' or `-m'. Turns off `-W/-w' line
1785 truncation; no column alignment used; may be used with
1786 `--sep-string[=STRING]'. `-J' has been introduced (together with
1787 `-W' and `--sep-string') to disentangle the old (POSIX-compliant)
1788 options `-w' and `-s' along with the three column options.
1791 `--length=PAGE_LENGTH'
1792 Set the page length to PAGE_LENGTH (default 66) lines, including
1793 the lines of the header [and the footer]. If PAGE_LENGTH is less
1794 than or equal to 10 (or <= 3 with `-F'), the header and footer are
1795 omitted, and all form feeds set in input files are eliminated, as
1796 if the `-T' option had been given.
1800 Merge and print all FILEs in parallel, one in each column. If a
1801 line is too long to fit in a column, it is truncated, unless the
1802 `-J' option is used. `--sep-string[=STRING]' may be used. Empty
1803 pages in some FILEs (form feeds set) produce empty columns, still
1804 marked by STRING. The result is a continuous line numbering and
1805 column marking throughout the whole merged file. Completely empty
1806 merged pages show no separators or line numbers. The default
1807 header becomes `DATE PAGE' with spaces inserted in the middle; this
1808 may be used with the `-h' or `--header' option to fill up the
1811 `-n[NUMBER-SEPARATOR[DIGITS]]'
1812 `--number-lines[=NUMBER-SEPARATOR[DIGITS]]'
1813 Provide DIGITS digit line numbering (default for DIGITS is 5).
1814 With multicolumn output the number occupies the first DIGITS
1815 column positions of each text column or only each line of `-m'
1816 output. With single column output the number precedes each line
1817 just as `-m' does. Default counting of the line numbers starts
1818 with the first line of the input file (not the first line printed,
1819 compare the `--page' option and `-N' option). Optional argument
1820 NUMBER-SEPARATOR is the character appended to the line number to
1821 separate it from the text followed. The default separator is the
1822 TAB character. In a strict sense a TAB is always printed with
1823 single column output only. The TAB-width varies with the
1824 TAB-position, e.g., with the left MARGIN specified by `-o' option.
1825 With multicolumn output priority is given to `equal width of
1826 output columns' (a POSIX specification). The TAB-width is fixed
1827 to the value of the first column and does not change with
1828 different values of left MARGIN. That means a fixed number of
1829 spaces is always printed in the place of the NUMBER-SEPARATOR TAB.
1830 The tabification depends upon the output position.
1833 `--first-line-number=LINE_NUMBER'
1834 Start line counting with the number LINE_NUMBER at first line of
1835 first page printed (in most cases not the first line of the input
1840 Indent each line with a margin MARGIN spaces wide (default is
1841 zero). The total page width is the size of the margin plus the
1842 PAGE_WIDTH set with the `-W/-w' option. A limited overflow may
1843 occur with numbered single column output (compare `-n' option).
1846 `--no-file-warnings'
1847 Do not print a warning message when an argument FILE cannot be
1848 opened. (The exit status will still be nonzero, however.)
1851 `--separator[=CHAR]'
1852 Separate columns by a single character CHAR. The default for CHAR
1853 is the TAB character without `-w' and `no character' with `-w'.
1854 Without `-s' the default separator `space' is set. `-s[char]'
1855 turns off line truncation of all three column options
1856 (`-COLUMN'|`-a -COLUMN'|`-m') unless `-w' is set. This is a
1857 POSIX-compliant formulation.
1860 `--sep-string[=STRING]'
1861 Use STRING to separate output columns. The `-S' option doesn't
1862 affect the `-W/-w' option, unlike the `-s' option which does. It
1863 does not affect line truncation or column alignment. Without
1864 `-S', and with `-J', `pr' uses the default output separator, TAB.
1865 Without `-S' or `-J', `pr' uses a `space' (same as `-S" "').
1866 `--sep-string' with no `=STRING' is equivalent to
1871 Do not print the usual header [and footer] on each page, and do
1872 not fill out the bottom of pages (with blank lines or a form
1873 feed). No page structure is produced, but form feeds set in the
1874 input files are retained. The predefined pagination is not
1875 changed. `-t' or `-T' may be useful together with other options;
1876 e.g.: `-t -e4', expand TAB characters in the input file to 4
1877 spaces but don't make any other changes. Use of `-t' overrides
1882 Do not print header [and footer]. In addition eliminate all form
1883 feeds set in the input files.
1886 `--show-nonprinting'
1887 Print nonprinting characters in octal backslash notation.
1890 `--width=PAGE_WIDTH'
1891 Set page width to PAGE_WIDTH characters for multiple text-column
1892 output only (default for PAGE_WIDTH is 72). `-s[CHAR]' turns off
1893 the default page width and any line truncation and column
1894 alignment. Lines of full length are merged, regardless of the
1895 column options set. No PAGE_WIDTH setting is possible with single
1896 column output. A POSIX-compliant formulation.
1899 `--page_width=PAGE_WIDTH'
1900 Set the page width to PAGE_WIDTH characters. That's valid with and
1901 without a column option. Text lines are truncated, unless `-J' is
1902 used. Together with one of the three column options (`-COLUMN',
1903 `-a -COLUMN' or `-m') column alignment is always used. The
1904 separator options `-S' or `-s' don't affect the `-W' option.
1905 Default is 72 characters. Without `-W PAGE_WIDTH' and without any
1906 of the column options NO line truncation is used (defined to keep
1907 downward compatibility and to meet most frequent tasks). That's
1908 equivalent to `-W 72 -J'. The header line is never truncated.
1911 An exit status of zero indicates success, and a nonzero value
1915 File: coreutils.info, Node: fold invocation, Prev: pr invocation, Up: Formatting file contents
1917 4.3 `fold': Wrap input lines to fit in specified width
1918 ======================================================
1920 `fold' writes each FILE (`-' means standard input), or standard input
1921 if none are given, to standard output, breaking long lines. Synopsis:
1923 fold [OPTION]... [FILE]...
1925 By default, `fold' breaks lines wider than 80 columns. The output
1926 is split into as many lines as necessary.
1928 `fold' counts screen columns by default; thus, a tab may count more
1929 than one column, backspace decreases the column count, and carriage
1930 return sets the column to zero.
1932 The program accepts the following options. Also see *Note Common
1937 Count bytes rather than columns, so that tabs, backspaces, and
1938 carriage returns are each counted as taking up one column, just
1939 like other characters.
1943 Break at word boundaries: the line is broken after the last blank
1944 before the maximum line length. If the line contains no such
1945 blanks, the line is broken at the maximum line length as usual.
1949 Use a maximum line length of WIDTH columns instead of 80.
1951 For compatibility `fold' supports an obsolete option syntax
1952 `-WIDTH'. New scripts should use `-w WIDTH' instead.
1955 An exit status of zero indicates success, and a nonzero value
1959 File: coreutils.info, Node: Output of parts of files, Next: Summarizing files, Prev: Formatting file contents, Up: Top
1961 5 Output of parts of files
1962 **************************
1964 These commands output pieces of the input.
1968 * head invocation:: Output the first part of files.
1969 * tail invocation:: Output the last part of files.
1970 * split invocation:: Split a file into fixed-size pieces.
1971 * csplit invocation:: Split a file into context-determined pieces.
1974 File: coreutils.info, Node: head invocation, Next: tail invocation, Up: Output of parts of files
1976 5.1 `head': Output the first part of files
1977 ==========================================
1979 `head' prints the first part (10 lines by default) of each FILE; it
1980 reads from standard input if no files are given or when given a FILE of
1983 head [OPTION]... [FILE]...
1985 If more than one FILE is specified, `head' prints a one-line header
1990 before the output for each FILE.
1992 The program accepts the following options. Also see *Note Common
1997 Print the first N bytes, instead of initial lines. Appending `b'
1998 multiplies N by 512, `k' by 1024, and `m' by 1048576. However, if
1999 N starts with a `-', print all but the last N bytes of each file.
2003 Output the first N lines. However, if N starts with a `-', print
2004 all but the last N lines of each file.
2009 Never print file name headers.
2013 Always print file name headers.
2016 For compatibility `head' also supports an obsolete option syntax
2017 `-COUNTOPTIONS', which is recognized only if it is specified first.
2018 COUNT is a decimal number optionally followed by a size letter (`b',
2019 `k', `m') as in `-c', or `l' to mean count by lines, or other option
2020 letters (`cqv'). Scripts intended for standard hosts should use `-c
2021 COUNT' or `-n COUNT' instead. If your script must also run on hosts
2022 that support only the obsolete syntax, it is usually simpler to avoid
2023 `head', e.g., by using `sed 5q' instead of `head -5'.
2025 An exit status of zero indicates success, and a nonzero value
2029 File: coreutils.info, Node: tail invocation, Next: split invocation, Prev: head invocation, Up: Output of parts of files
2031 5.2 `tail': Output the last part of files
2032 =========================================
2034 `tail' prints the last part (10 lines by default) of each FILE; it
2035 reads from standard input if no files are given or when given a FILE of
2038 tail [OPTION]... [FILE]...
2040 If more than one FILE is specified, `tail' prints a one-line header
2045 before the output for each FILE.
2047 GNU `tail' can output any amount of data (some other versions of
2048 `tail' cannot). It also has no `-r' option (print in reverse), since
2049 reversing a file is really a different job from printing the end of a
2050 file; BSD `tail' (which is the one with `-r') can only reverse files
2051 that are at most as large as its buffer, which is typically 32 KiB. A
2052 more reliable and versatile way to reverse files is the GNU `tac'
2055 If any option-argument is a number N starting with a `+', `tail'
2056 begins printing with the Nth item from the start of each file, instead
2059 The program accepts the following options. Also see *Note Common
2064 Output the last BYTES bytes, instead of final lines. Appending
2065 `b' multiplies BYTES by 512, `k' by 1024, and `m' by 1048576.
2069 Loop forever trying to read more characters at the end of the file,
2070 presumably because the file is growing. If more than one file is
2071 given, `tail' prints a header whenever it gets output from a
2072 different file, to indicate which file that output is from.
2074 There are two ways to specify how you'd like to track files with
2075 this option, but that difference is noticeable only when a
2076 followed file is removed or renamed. If you'd like to continue to
2077 track the end of a growing file even after it has been unlinked,
2078 use `--follow=descriptor'. This is the default behavior, but it
2079 is not useful if you're tracking a log file that may be rotated
2080 (removed or renamed, then reopened). In that case, use
2081 `--follow=name' to track the named file by reopening it
2082 periodically to see if it has been removed and recreated by some
2085 No matter which method you use, if the tracked file is determined
2086 to have shrunk, `tail' prints a message saying the file has been
2087 truncated and resumes tracking the end of the file from the
2088 newly-determined endpoint.
2090 When a file is removed, `tail''s behavior depends on whether it is
2091 following the name or the descriptor. When following by name,
2092 tail can detect that a file has been removed and gives a message
2093 to that effect, and if `--retry' has been specified it will
2094 continue checking periodically to see if the file reappears. When
2095 following a descriptor, tail does not detect that the file has
2096 been unlinked or renamed and issues no message; even though the
2097 file may no longer be accessible via its original name, it may
2100 The option values `descriptor' and `name' may be specified only
2101 with the long form of the option, not with `-f'.
2103 If `POSIXLY_CORRECT' is set, the `-f' option is ignored if no FILE
2104 operand is specified and standard input is a FIFO or a pipe.
2107 This option is the same as `--follow=name --retry'. That is, tail
2108 will attempt to reopen a file when it is removed. Should this
2109 fail, tail will keep trying until it becomes accessible again.
2112 This option is useful mainly when following by name (i.e., with
2113 `--follow=name'). Without this option, when tail encounters a
2114 file that doesn't exist or is otherwise inaccessible, it reports
2115 that fact and never checks it again.
2117 `--sleep-interval=NUMBER'
2118 Change the number of seconds to wait between iterations (the
2119 default is 1.0). During one iteration, every specified file is
2120 checked to see if it has changed size. Historical implementations
2121 of `tail' have required that NUMBER be an integer. However, GNU
2122 `tail' accepts an arbitrary floating point number (using a period
2123 before any fractional digits).
2126 When following by name or by descriptor, you may specify the
2127 process ID, PID, of the sole writer of all FILE arguments. Then,
2128 shortly after that process terminates, tail will also terminate.
2129 This will work properly only if the writer and the tailing process
2130 are running on the same machine. For example, to save the output
2131 of a build in a file and to watch the file grow, if you invoke
2132 `make' and `tail' like this then the tail process will stop when
2133 your build completes. Without this option, you would have had to
2134 kill the `tail -f' process yourself.
2136 $ make >& makerr & tail --pid=$! -f makerr
2138 If you specify a PID that is not in use or that does not correspond
2139 to the process that is writing to the tailed files, then `tail'
2140 may terminate long before any FILEs stop growing or it may not
2141 terminate until long after the real writer has terminated. Note
2142 that `--pid' cannot be supported on some systems; `tail' will
2143 print a warning if this is the case.
2145 `--max-unchanged-stats=N'
2146 When tailing a file by name, if there have been N (default
2147 n=5) consecutive iterations for which the file has not changed,
2148 then `open'/`fstat' the file to determine if that file name is
2149 still associated with the same device/inode-number pair as before.
2150 When following a log file that is rotated, this is approximately
2151 the number of seconds between when tail prints the last
2152 pre-rotation lines and when it prints the lines that have
2153 accumulated in the new log file. This option is meaningful only
2154 when following by name.
2158 Output the last N lines.
2163 Never print file name headers.
2167 Always print file name headers.
2170 For compatibility `tail' also supports an obsolete usage `tail
2171 -[COUNT][bcl][f] [FILE]', which is recognized only if it does not
2172 conflict with the usage described above. This obsolete form uses
2173 exactly one option and at most one file. In the option, COUNT is an
2174 optional decimal number optionally followed by a size letter (`b', `c',
2175 `l') to mean count by 512-byte blocks, bytes, or lines, optionally
2176 followed by `f' which has the same meaning as `-f'.
2178 On older systems, the leading `-' can be replaced by `+' in the
2179 obsolete option syntax with the same meaning as in counts, and obsolete
2180 usage overrides normal usage when the two conflict. This obsolete
2181 behavior can be enabled or disabled with the `_POSIX2_VERSION'
2182 environment variable (*note Standards conformance::).
2184 Scripts intended for use on standard hosts should avoid obsolete
2185 syntax and should use `-c COUNT[b]', `-n COUNT', and/or `-f' instead.
2186 If your script must also run on hosts that support only the obsolete
2187 syntax, you can often rewrite it to avoid problematic usages, e.g., by
2188 using `sed -n '$p'' rather than `tail -1'. If that's not possible, the
2189 script can use a test like `if tail -c +1 </dev/null >/dev/null 2>&1;
2190 then ...' to decide which syntax to use.
2192 Even if your script assumes the standard behavior, you should still
2193 beware usages whose behaviors differ depending on the POSIX version.
2194 For example, avoid `tail - main.c', since it might be interpreted as
2195 either `tail main.c' or as `tail -- - main.c'; avoid `tail -c 4', since
2196 it might mean either `tail -c4' or `tail -c 10 4'; and avoid `tail +4',
2197 since it might mean either `tail ./+4' or `tail -n +4'.
2199 An exit status of zero indicates success, and a nonzero value
2203 File: coreutils.info, Node: split invocation, Next: csplit invocation, Prev: tail invocation, Up: Output of parts of files
2205 5.3 `split': Split a file into fixed-size pieces
2206 ================================================
2208 `split' creates output files containing consecutive sections of INPUT
2209 (standard input if none is given or INPUT is `-'). Synopsis:
2211 split [OPTION] [INPUT [PREFIX]]
2213 By default, `split' puts 1000 lines of INPUT (or whatever is left
2214 over for the last section), into each output file.
2216 The output files' names consist of PREFIX (`x' by default) followed
2217 by a group of characters (`aa', `ab', ... by default), such that
2218 concatenating the output files in traditional sorted order by file name
2219 produces the original input file. If the output file names are
2220 exhausted, `split' reports an error without deleting the output files
2223 The program accepts the following options. Also see *Note Common
2227 `--suffix-length=LENGTH'
2228 Use suffixes of length LENGTH. The default LENGTH is 2.
2232 Put LINES lines of INPUT into each output file.
2234 For compatibility `split' also supports an obsolete option syntax
2235 `-LINES'. New scripts should use `-l LINES' instead.
2239 Put the first BYTES bytes of INPUT into each output file.
2240 Appending `b' multiplies BYTES by 512, `k' by 1024, and `m' by
2244 `--line-bytes=BYTES'
2245 Put into each output file as many complete lines of INPUT as
2246 possible without exceeding BYTES bytes. For lines longer than
2247 BYTES bytes, put BYTES bytes into each output file until less than
2248 BYTES bytes of the line are left, then continue normally. BYTES
2249 has the same format as for the `--bytes' option.
2252 `--numeric-suffixes'
2253 Use digits in suffixes rather than lower-case letters.
2256 Write a diagnostic to standard error just before each output file
2260 An exit status of zero indicates success, and a nonzero value
2264 File: coreutils.info, Node: csplit invocation, Prev: split invocation, Up: Output of parts of files
2266 5.4 `csplit': Split a file into context-determined pieces
2267 =========================================================
2269 `csplit' creates zero or more output files containing sections of INPUT
2270 (standard input if INPUT is `-'). Synopsis:
2272 csplit [OPTION]... INPUT PATTERN...
2274 The contents of the output files are determined by the PATTERN
2275 arguments, as detailed below. An error occurs if a PATTERN argument
2276 refers to a nonexistent line of the input file (e.g., if no remaining
2277 line matches a given regular expression). After every PATTERN has been
2278 matched, any remaining input is copied into one last output file.
2280 By default, `csplit' prints the number of bytes written to each
2281 output file after it has been created.
2283 The types of pattern arguments are:
2286 Create an output file containing the input up to but not including
2287 line N (a positive integer). If followed by a repeat count, also
2288 create an output file containing the next N lines of the input
2289 file once for each repeat.
2292 Create an output file containing the current line up to (but not
2293 including) the next line of the input file that contains a match
2294 for REGEXP. The optional OFFSET is an integer. If it is given,
2295 the input up to (but not including) the matching line plus or
2296 minus OFFSET is put into the output file, and the line after that
2297 begins the next section of input.
2300 Like the previous type, except that it does not create an output
2301 file, so that section of the input file is effectively ignored.
2304 Repeat the previous pattern REPEAT-COUNT additional times. The
2305 REPEAT-COUNT can either be a positive integer or an asterisk,
2306 meaning repeat as many times as necessary until the input is
2310 The output files' names consist of a prefix (`xx' by default)
2311 followed by a suffix. By default, the suffix is an ascending sequence
2312 of two-digit decimal numbers from `00' to `99'. In any case,
2313 concatenating the output files in sorted order by file name produces the
2314 original input file.
2316 By default, if `csplit' encounters an error or receives a hangup,
2317 interrupt, quit, or terminate signal, it removes any output files that
2318 it has created so far before it exits.
2320 The program accepts the following options. Also see *Note Common
2325 Use PREFIX as the output file name prefix.
2329 Use SUFFIX as the output file name suffix. When this option is
2330 specified, the suffix string must include exactly one
2331 `printf(3)'-style conversion specification, possibly including
2332 format specification flags, a field width, a precision
2333 specifications, or all of these kinds of modifiers. The format
2334 letter must convert a binary integer argument to readable form;
2335 thus, only `d', `i', `u', `o', `x', and `X' conversions are
2336 allowed. The entire SUFFIX is given (with the current output file
2337 number) to `sprintf(3)' to form the file name suffixes for each of
2338 the individual output files in turn. If this option is used, the
2339 `--digits' option is ignored.
2343 Use output file names containing numbers that are DIGITS digits
2344 long instead of the default 2.
2348 Do not remove output files when errors are encountered.
2351 `--elide-empty-files'
2352 Suppress the generation of zero-length output files. (In cases
2353 where the section delimiters of the input file are supposed to
2354 mark the first lines of each of the sections, the first output
2355 file will generally be a zero-length file unless you use this
2356 option.) The output file sequence numbers always run
2357 consecutively starting from 0, even when this option is specified.
2363 Do not print counts of output file sizes.
2366 An exit status of zero indicates success, and a nonzero value
2370 File: coreutils.info, Node: Summarizing files, Next: Operating on sorted files, Prev: Output of parts of files, Up: Top
2375 These commands generate just a few numbers representing entire contents
2380 * wc invocation:: Print newline, word, and byte counts.
2381 * sum invocation:: Print checksum and block counts.
2382 * cksum invocation:: Print CRC checksum and byte counts.
2383 * md5sum invocation:: Print or check MD5 digests.
2384 * sha1sum invocation:: Print or check SHA-1 digests.
2385 * sha2 utilities:: Print or check SHA-2 digests.
2388 File: coreutils.info, Node: wc invocation, Next: sum invocation, Up: Summarizing files
2390 6.1 `wc': Print newline, word, and byte counts
2391 ==============================================
2393 `wc' counts the number of bytes, characters, whitespace-separated
2394 words, and newlines in each given FILE, or standard input if none are
2395 given or for a FILE of `-'. Synopsis:
2397 wc [OPTION]... [FILE]...
2399 `wc' prints one line of counts for each file, and if the file was
2400 given as an argument, it prints the file name following the counts. If
2401 more than one FILE is given, `wc' prints a final line containing the
2402 cumulative counts, with the file name `total'. The counts are printed
2403 in this order: newlines, words, characters, bytes, maximum line length.
2404 Each count is printed right-justified in a field with at least one
2405 space between fields so that the numbers and file names normally line
2406 up nicely in columns. The width of the count fields varies depending
2407 on the inputs, so you should not depend on a particular field width.
2408 However, as a GNU extension, if only one count is printed, it is
2409 guaranteed to be printed without leading spaces.
2411 By default, `wc' prints three counts: the newline, words, and byte
2412 counts. Options can specify that only certain counts be printed.
2413 Options do not undo others previously given, so
2417 prints both the byte counts and the word counts.
2419 With the `--max-line-length' option, `wc' prints the length of the
2420 longest line per file, and if there is more than one file it prints the
2421 maximum (not the sum) of those lengths.
2423 The program accepts the following options. Also see *Note Common
2428 Print only the byte counts.
2432 Print only the character counts.
2436 Print only the word counts.
2440 Print only the newline counts.
2444 Print only the maximum line lengths.
2446 `--files0-from=FILE'
2447 Rather than processing files named on the command line, process
2448 those named in file FILE; each name is terminated by a null byte.
2449 This is useful when the list of file names is so long that it may
2450 exceed a command line length limitation. In such cases, running
2451 `wc' via `xargs' is undesirable because it splits the list into
2452 pieces and makes `wc' print a total for each sublist rather than
2453 for the entire list. One way to produce a list of
2454 null-byte-terminated file names is with GNU `find', using its
2455 `-print0' predicate. For example, to find the length of the
2456 longest line in any `.c' or `.h' file in the current hierarchy, do
2459 find . -name '*.[ch]' -print0 | wc -L --files0-from=- | tail -n1
2461 Do not specify any FILE on the command line when using this option.
2464 An exit status of zero indicates success, and a nonzero value
2468 File: coreutils.info, Node: sum invocation, Next: cksum invocation, Prev: wc invocation, Up: Summarizing files
2470 6.2 `sum': Print checksum and block counts
2471 ==========================================
2473 `sum' computes a 16-bit checksum for each given FILE, or standard input
2474 if none are given or for a FILE of `-'. Synopsis:
2476 sum [OPTION]... [FILE]...
2478 `sum' prints the checksum for each FILE followed by the number of
2479 blocks in the file (rounded up). If more than one FILE is given, file
2480 names are also printed (by default). (With the `--sysv' option,
2481 corresponding file names are printed when there is at least one file
2484 By default, GNU `sum' computes checksums using an algorithm
2485 compatible with BSD `sum' and prints file sizes in units of 1024-byte
2488 The program accepts the following options. Also see *Note Common
2492 Use the default (BSD compatible) algorithm. This option is
2493 included for compatibility with the System V `sum'. Unless `-s'
2494 was also given, it has no effect.
2498 Compute checksums using an algorithm compatible with System V
2499 `sum''s default, and print file sizes in units of 512-byte blocks.
2502 `sum' is provided for compatibility; the `cksum' program (see next
2503 section) is preferable in new applications.
2505 An exit status of zero indicates success, and a nonzero value
2509 File: coreutils.info, Node: cksum invocation, Next: md5sum invocation, Prev: sum invocation, Up: Summarizing files
2511 6.3 `cksum': Print CRC checksum and byte counts
2512 ===============================================
2514 `cksum' computes a cyclic redundancy check (CRC) checksum for each
2515 given FILE, or standard input if none are given or for a FILE of `-'.
2518 cksum [OPTION]... [FILE]...
2520 `cksum' prints the CRC checksum for each file along with the number
2521 of bytes in the file, and the file name unless no arguments were given.
2523 `cksum' is typically used to ensure that files transferred by
2524 unreliable means (e.g., netnews) have not been corrupted, by comparing
2525 the `cksum' output for the received files with the `cksum' output for
2526 the original files (typically given in the distribution).
2528 The CRC algorithm is specified by the POSIX standard. It is not
2529 compatible with the BSD or System V `sum' algorithms (see the previous
2530 section); it is more robust.
2532 The only options are `--help' and `--version'. *Note Common
2535 An exit status of zero indicates success, and a nonzero value
2539 File: coreutils.info, Node: md5sum invocation, Next: sha1sum invocation, Prev: cksum invocation, Up: Summarizing files
2541 6.4 `md5sum': Print or check MD5 digests
2542 ========================================
2544 `md5sum' computes a 128-bit checksum (or "fingerprint" or
2545 "message-digest") for each specified FILE.
2547 Note: The MD5 digest is more reliable than a simple CRC (provided by
2548 the `cksum' command) for detecting accidental file corruption, as the
2549 chances of accidentally having two files with identical MD5 are
2550 vanishingly small. However, it should not be considered truly secure
2551 against malicious tampering: although finding a file with a given MD5
2552 fingerprint, or modifying a file so as to retain its MD5 are considered
2553 infeasible at the moment, it is known how to produce different files
2554 with identical MD5 (a "collision"), something which can be a security
2555 issue in certain contexts. For more secure hashes, consider using
2556 SHA-1 or SHA-2. *Note sha1sum invocation::, and *Note sha2 utilities::.
2558 If a FILE is specified as `-' or if no files are given `md5sum'
2559 computes the checksum for the standard input. `md5sum' can also
2560 determine whether a file and checksum are consistent. Synopsis:
2562 md5sum [OPTION]... [FILE]...
2564 For each FILE, `md5sum' outputs the MD5 checksum, a flag indicating
2565 a binary or text input file, and the file name. If FILE contains a
2566 backslash or newline, the line is started with a backslash, and each
2567 problematic character in the file name is escaped with a backslash,
2568 making the output unambiguous even in the presence of arbitrary file
2569 names. If FILE is omitted or specified as `-', standard input is read.
2571 The program accepts the following options. Also see *Note Common
2576 Treat each input file as binary, by reading it in binary mode and
2577 outputting a `*' flag. This is the inverse of `--text'. On
2578 systems like GNU that do not distinguish between binary and text
2579 files, this option merely flags each input file as binary: the MD5
2580 checksum is unaffected. This option is the default on systems
2581 like MS-DOS that distinguish between binary and text files, except
2582 for reading standard input when standard input is a terminal.
2586 Read file names and checksum information (not data) from each FILE
2587 (or from stdin if no FILE was specified) and report whether the
2588 checksums match the contents of the named files. The input to
2589 this mode of `md5sum' is usually the output of a prior,
2590 checksum-generating run of `md5sum'. Each valid line of input
2591 consists of an MD5 checksum, a binary/text flag, and then a file
2592 name. Binary files are marked with `*', text with ` '. For each
2593 such line, `md5sum' reads the named file and computes its MD5
2594 checksum. Then, if the computed message digest does not match the
2595 one on the line with the file name, the file is noted as having
2596 failed the test. Otherwise, the file passes the test. By
2597 default, for each valid line, one line is written to standard
2598 output indicating whether the named file passed the test. After
2599 all checks have been performed, if there were any failures, a
2600 warning is issued to standard error. Use the `--status' option to
2601 inhibit that output. If any listed file cannot be opened or read,
2602 if any valid line has an MD5 checksum inconsistent with the
2603 associated file, or if no valid line is found, `md5sum' exits with
2604 nonzero status. Otherwise, it exits successfully.
2607 This option is useful only when verifying checksums. When
2608 verifying checksums, don't generate the default one-line-per-file
2609 diagnostic and don't output the warning summarizing any failures.
2610 Failures to open or read a file still evoke individual diagnostics
2611 to standard error. If all listed files are readable and are
2612 consistent with the associated MD5 checksums, exit successfully.
2613 Otherwise exit with a status code indicating there was a failure.
2617 Treat each input file as text, by reading it in text mode and
2618 outputting a ` ' flag. This is the inverse of `--binary'. This
2619 option is the default on systems like GNU that do not distinguish
2620 between binary and text files. On other systems, it is the
2621 default for reading standard input when standard input is a
2626 When verifying checksums, warn about improperly formatted MD5
2627 checksum lines. This option is useful only if all but a few lines
2628 in the checked input are valid.
2631 An exit status of zero indicates success, and a nonzero value
2635 File: coreutils.info, Node: sha1sum invocation, Next: sha2 utilities, Prev: md5sum invocation, Up: Summarizing files
2637 6.5 `sha1sum': Print or check SHA-1 digests
2638 ===========================================
2640 `sha1sum' computes a 160-bit checksum for each specified FILE. The
2641 usage and options of this command are precisely the same as for
2642 `md5sum'. *Note md5sum invocation::.
2644 Note: The SHA-1 digest is more secure than MD5, and no collisions of
2645 it are known (different files having the same fingerprint). However,
2646 it is known that they can be produced with considerable, but not
2647 unreasonable, resources. For this reason, it is generally considered
2648 that SHA-1 should be gradually phased out in favor of the more secure
2649 SHA-2 hash algorithms. *Note sha2 utilities::.
2652 File: coreutils.info, Node: sha2 utilities, Prev: sha1sum invocation, Up: Summarizing files
2654 6.6 sha2 utilities: Print or check SHA-2 digests
2655 ================================================
2657 The commands `sha224sum', `sha256sum', `sha384sum' and `sha512sum'
2658 compute checksums of various lengths (respectively 224, 256, 384 and
2659 512 bits), collectively known as the SHA-2 hashes. The usage and
2660 options of these commands are precisely the same as for `md5sum'.
2661 *Note md5sum invocation::.
2663 Note: The SHA384 and SHA512 digests are considerably slower to
2664 compute, especially on 32-bit computers, than SHA224 or SHA256.
2667 File: coreutils.info, Node: Operating on sorted files, Next: Operating on fields within a line, Prev: Summarizing files, Up: Top
2669 7 Operating on sorted files
2670 ***************************
2672 These commands work with (or produce) sorted files.
2676 * sort invocation:: Sort text files.
2677 * shuf invocation:: Shuffle text files.
2678 * uniq invocation:: Uniquify files.
2679 * comm invocation:: Compare two sorted files line by line.
2680 * ptx invocation:: Produce a permuted index of file contents.
2681 * tsort invocation:: Topological sort.
2682 * tsort background:: Where tsort came from.
2685 File: coreutils.info, Node: sort invocation, Next: shuf invocation, Up: Operating on sorted files
2687 7.1 `sort': Sort text files
2688 ===========================
2690 `sort' sorts, merges, or compares all the lines from the given files,
2691 or standard input if none are given or for a FILE of `-'. By default,
2692 `sort' writes the results to standard output. Synopsis:
2694 sort [OPTION]... [FILE]...
2696 `sort' has three modes of operation: sort (the default), merge, and
2697 check for sortedness. The following options change the operation mode:
2701 `--check=diagnose-first'
2702 Check whether the given file is already sorted: if it is not all
2703 sorted, print a diagnostic containing the first out-of-order line
2704 and exit with a status of 1. Otherwise, exit successfully. At
2705 most one input file can be given.
2710 Exit successfully if the given file is already sorted, and exit
2711 with status 1 otherwise. At most one input file can be given.
2712 This is like `-c', except it does not print a diagnostic.
2716 Merge the given files by sorting them as a group. Each input file
2717 must always be individually sorted. It always works to sort
2718 instead of merge; merging is provided because it is faster, in the
2719 case where it works.
2722 A pair of lines is compared as follows: `sort' compares each pair of
2723 fields, in the order specified on the command line, according to the
2724 associated ordering options, until a difference is found or no fields
2725 are left. If no key fields are specified, `sort' uses a default key of
2726 the entire line. Finally, as a last resort when all keys compare
2727 equal, `sort' compares entire lines as if no ordering options other
2728 than `--reverse' (`-r') were specified. The `--stable' (`-s') option
2729 disables this "last-resort comparison" so that lines in which all
2730 fields compare equal are left in their original relative order. The
2731 `--unique' (`-u') option also disables the last-resort comparison.
2733 Unless otherwise specified, all comparisons use the character
2734 collating sequence specified by the `LC_COLLATE' locale.(1)
2736 GNU `sort' (as specified for all GNU utilities) has no limit on
2737 input line length or restrictions on bytes allowed within lines. In
2738 addition, if the final byte of an input file is not a newline, GNU
2739 `sort' silently supplies one. A line's trailing newline is not part of
2740 the line for comparison purposes.
2744 0 if no error occurred
2745 1 if invoked with `-c' or `-C' and the input is not sorted
2746 2 if an error occurred
2748 If the environment variable `TMPDIR' is set, `sort' uses its value
2749 as the directory for temporary files instead of `/tmp'. The
2750 `--temporary-directory' (`-T') option in turn overrides the environment
2753 The following options affect the ordering of output lines. They may
2754 be specified globally or as part of a specific key field. If no key
2755 fields are specified, global options apply to comparison of entire
2756 lines; otherwise the global options are inherited by key fields that do
2757 not specify any special options of their own. In pre-POSIX versions of
2758 `sort', global options affect only later key fields, so portable shell
2759 scripts should specify global options first.
2762 `--ignore-leading-blanks'
2763 Ignore leading blanks when finding sort keys in each line. By
2764 default a blank is a space or a tab, but the `LC_CTYPE' locale can
2768 `--dictionary-order'
2769 Sort in "phone directory" order: ignore all characters except
2770 letters, digits and blanks when sorting. By default letters and
2771 digits are those of ASCII and a blank is a space or a tab, but the
2772 `LC_CTYPE' locale can change this.
2776 Fold lowercase characters into the equivalent uppercase characters
2777 when comparing so that, for example, `b' and `B' sort as equal.
2778 The `LC_CTYPE' locale determines character types.
2781 `--general-numeric-sort'
2782 Sort numerically, using the standard C function `strtod' to convert
2783 a prefix of each line to a double-precision floating point number.
2784 This allows floating point numbers to be specified in scientific
2785 notation, like `1.0e-34' and `10e100'. The `LC_NUMERIC' locale
2786 determines the decimal-point character. Do not report overflow,
2787 underflow, or conversion errors. Use the following collating
2790 * Lines that do not start with numbers (all considered to be
2793 * NaNs ("Not a Number" values, in IEEE floating point
2794 arithmetic) in a consistent but machine-dependent order.
2798 * Finite numbers in ascending numeric order (with -0 and +0
2803 Use this option only if there is no alternative; it is much slower
2804 than `--numeric-sort' (`-n') and it can lose information when
2805 converting to floating point.
2808 `--ignore-nonprinting'
2809 Ignore nonprinting characters. The `LC_CTYPE' locale determines
2810 character types. This option has no effect if the stronger
2811 `--dictionary-order' (`-d') option is also given.
2815 An initial string, consisting of any amount of blanks, followed by
2816 a month name abbreviation, is folded to UPPER case and compared in
2817 the order `JAN' < `FEB' < ... < `DEC'. Invalid names compare low
2818 to valid names. The `LC_TIME' locale category determines the
2819 month spellings. By default a blank is a space or a tab, but the
2820 `LC_CTYPE' locale can change this.
2824 Sort numerically. The number begins each line and consists of
2825 optional blanks, an optional `-' sign, and zero or more digits
2826 possibly separated by thousands separators, optionally followed by
2827 a decimal-point character and zero or more digits. An empty
2828 number is treated as `0'. The `LC_NUMERIC' locale specifies the
2829 decimal-point character and thousands separator. By default a
2830 blank is a space or a tab, but the `LC_CTYPE' locale can change
2833 Comparison is exact; there is no rounding error.
2835 Neither a leading `+' nor exponential notation is recognized. To
2836 compare such strings numerically, use the `--general-numeric-sort'
2841 Reverse the result of comparison, so that lines with greater key
2842 values appear earlier in the output instead of later.
2846 Sort by hashing the input keys and then sorting the hash values.
2847 Choose the hash function at random, ensuring that it is free of
2848 collisions so that differing keys have differing hash values.
2849 This is like a random permutation of the inputs (*note shuf
2850 invocation::), except that keys with the same value sort together.
2852 If multiple random sort fields are specified, the same random hash
2853 function is used for all fields. To use different random hash
2854 functions for different fields, you can invoke `sort' more than
2857 The choice of hash function is affected by the `--random-source'
2863 `--compress-program=PROG'
2864 Compress any temporary files with the program PROG.
2866 With no arguments, PROG must compress standard input to standard
2867 output, and when given the `-d' option it must decompress standard
2868 input to standard output.
2870 Terminate with an error if PROG exits with nonzero status.
2872 Whitespace and the backslash character should not appear in PROG;
2873 they are reserved for future use.
2877 Specify a sort field that consists of the part of the line between
2878 POS1 and POS2 (or the end of the line, if POS2 is omitted),
2881 Each POS has the form `F[.C][OPTS]', where F is the number of the
2882 field to use, and C is the number of the first character from the
2883 beginning of the field. Fields and character positions are
2884 numbered starting with 1; a character position of zero in POS2
2885 indicates the field's last character. If `.C' is omitted from
2886 POS1, it defaults to 1 (the beginning of the field); if omitted
2887 from POS2, it defaults to 0 (the end of the field). OPTS are
2888 ordering options, allowing individual keys to be sorted according
2889 to different rules; see below for details. Keys can span multiple
2892 Example: To sort on the second field, use `--key=2,2' (`-k 2,2').
2893 See below for more examples.
2896 `--output=OUTPUT-FILE'
2897 Write output to OUTPUT-FILE instead of standard output. Normally,
2898 `sort' reads all input before opening OUTPUT-FILE, so you can
2899 safely sort a file in place by using commands like `sort -o F F'
2900 and `cat F | sort -o F'. However, `sort' with `--merge' (`-m')
2901 can open the output file before reading all input, so a command
2902 like `cat F | sort -m -o F - G' is not safe as `sort' might start
2903 writing `F' before `cat' is done reading it.
2905 On newer systems, `-o' cannot appear after an input file if
2906 `POSIXLY_CORRECT' is set, e.g., `sort F -o F'. Portable scripts
2907 should specify `-o OUTPUT-FILE' before any input files.
2909 `--random-source=FILE'
2910 Use FILE as a source of random data used to determine which random
2911 hash function to use with the `-R' option. *Note Random sources::.
2915 Make `sort' stable by disabling its last-resort comparison. This
2916 option has no effect if no fields or global ordering options other
2917 than `--reverse' (`-r') are specified.
2920 `--buffer-size=SIZE'
2921 Use a main-memory sort buffer of the given SIZE. By default, SIZE
2922 is in units of 1024 bytes. Appending `%' causes SIZE to be
2923 interpreted as a percentage of physical memory. Appending `K'
2924 multiplies SIZE by 1024 (the default), `M' by 1,048,576, `G' by
2925 1,073,741,824, and so on for `T', `P', `E', `Z', and `Y'.
2926 Appending `b' causes SIZE to be interpreted as a byte count, with
2929 This option can improve the performance of `sort' by causing it to
2930 start with a larger or smaller sort buffer than the default.
2931 However, this option affects only the initial buffer size. The
2932 buffer grows beyond SIZE if `sort' encounters input lines larger
2936 `--field-separator=SEPARATOR'
2937 Use character SEPARATOR as the field separator when finding the
2938 sort keys in each line. By default, fields are separated by the
2939 empty string between a non-blank character and a blank character.
2940 By default a blank is a space or a tab, but the `LC_CTYPE' locale
2943 That is, given the input line ` foo bar', `sort' breaks it into
2944 fields ` foo' and ` bar'. The field separator is not considered
2945 to be part of either the field preceding or the field following,
2946 so with `sort -t " "' the same input line has three fields: an
2947 empty field, `foo', and `bar'. However, fields that extend to the
2948 end of the line, as `-k 2', or fields consisting of a range, as
2949 `-k 2,3', retain the field separators present between the
2950 endpoints of the range.
2952 To specify a null character (ASCII NUL) as the field separator,
2953 use the two-character string `\0', e.g., `sort -t '\0''.
2956 `--temporary-directory=TEMPDIR'
2957 Use directory TEMPDIR to store temporary files, overriding the
2958 `TMPDIR' environment variable. If this option is given more than
2959 once, temporary files are stored in all the directories given. If
2960 you have a large sort or merge that is I/O-bound, you can often
2961 improve performance by using this option to specify directories on
2962 different disks and controllers.
2966 Normally, output only the first of a sequence of lines that compare
2967 equal. For the `--check' (`-c' or `-C') option, check that no
2968 pair of consecutive lines compares equal.
2970 This option also disables the default last-resort comparison.
2972 The commands `sort -u' and `sort | uniq' are equivalent, but this
2973 equivalence does not extend to arbitrary `sort' options. For
2974 example, `sort -n -u' inspects only the value of the initial
2975 numeric string when checking for uniqueness, whereas `sort -n |
2976 uniq' inspects the entire line. *Note uniq invocation::.
2980 Treat the input as a set of lines, each terminated by a null
2981 character (ASCII NUL) instead of a line feed (ASCII LF). This
2982 option can be useful in conjunction with `perl -0' or `find
2983 -print0' and `xargs -0' which do the same in order to reliably
2984 handle arbitrary file names (even those containing blanks or other
2985 special characters).
2988 Historical (BSD and System V) implementations of `sort' have
2989 differed in their interpretation of some options, particularly `-b',
2990 `-f', and `-n'. GNU sort follows the POSIX behavior, which is usually
2991 (but not always!) like the System V behavior. According to POSIX, `-n'
2992 no longer implies `-b'. For consistency, `-M' has been changed in the
2993 same way. This may affect the meaning of character positions in field
2994 specifications in obscure cases. The only fix is to add an explicit
2997 A position in a sort field specified with `-k' may have any of the
2998 option letters `Mbdfinr' appended to it, in which case the global
2999 ordering options are not used for that particular field. The `-b'
3000 option may be independently attached to either or both of the start and
3001 end positions of a field specification, and if it is inherited from the
3002 global options it will be attached to both. If input lines can contain
3003 leading or adjacent blanks and `-t' is not used, then `-k' is typically
3004 combined with `-b', `-g', `-M', or `-n'; otherwise the varying numbers
3005 of leading blanks in fields can cause confusing results.
3007 If the start position in a sort field specifier falls after the end
3008 of the line or after the end field, the field is empty. If the `-b'
3009 option was specified, the `.C' part of a field specification is counted
3010 from the first nonblank character of the field.
3012 On older systems, `sort' supports an obsolete origin-zero syntax
3013 `+POS1 [-POS2]' for specifying sort keys. This obsolete behavior can
3014 be enabled or disabled with the `_POSIX2_VERSION' environment variable
3015 (*note Standards conformance::); it can also be enabled when
3016 `POSIXLY_CORRECT' is not set by using the obsolete syntax with `-POS2'
3019 Scripts intended for use on standard hosts should avoid obsolete
3020 syntax and should use `-k' instead. For example, avoid `sort +2',
3021 since it might be interpreted as either `sort ./+2' or `sort -k 3'. If
3022 your script must also run on hosts that support only the obsolete
3023 syntax, it can use a test like `if sort -k 1 </dev/null >/dev/null
3024 2>&1; then ...' to decide which syntax to use.
3026 Here are some examples to illustrate various combinations of options.
3028 * Sort in descending (reverse) numeric order.
3032 * Sort alphabetically, omitting the first and second fields and the
3033 blanks at the start of the third field. This uses a single key
3034 composed of the characters beginning at the start of the first
3035 nonblank character in field three and extending to the end of each
3040 * Sort numerically on the second field and resolve ties by sorting
3041 alphabetically on the third and fourth characters of field five.
3042 Use `:' as the field delimiter.
3044 sort -t : -k 2,2n -k 5.3,5.4
3046 Note that if you had written `-k 2n' instead of `-k 2,2n' `sort'
3047 would have used all characters beginning in the second field and
3048 extending to the end of the line as the primary _numeric_ key.
3049 For the large majority of applications, treating keys spanning
3050 more than one field as numeric will not do what you expect.
3052 Also note that the `n' modifier was applied to the field-end
3053 specifier for the first key. It would have been equivalent to
3054 specify `-k 2n,2' or `-k 2n,2n'. All modifiers except `b' apply
3055 to the associated _field_, regardless of whether the modifier
3056 character is attached to the field-start and/or the field-end part
3057 of the key specifier.
3059 * Sort the password file on the fifth field and ignore any leading
3060 blanks. Sort lines with equal values in field five on the numeric
3061 user ID in field three. Fields are separated by `:'.
3063 sort -t : -k 5b,5 -k 3,3n /etc/passwd
3064 sort -t : -n -k 5b,5 -k 3,3 /etc/passwd
3065 sort -t : -b -k 5,5 -k 3,3n /etc/passwd
3067 These three commands have equivalent effect. The first specifies
3068 that the first key's start position ignores leading blanks and the
3069 second key is sorted numerically. The other two commands rely on
3070 global options being inherited by sort keys that lack modifiers.
3071 The inheritance works in this case because `-k 5b,5b' and `-k
3072 5b,5' are equivalent, as the location of a field-end lacking a `.C'
3073 character position is not affected by whether initial blanks are
3076 * Sort a set of log files, primarily by IPv4 address and secondarily
3077 by time stamp. If two lines' primary and secondary keys are
3078 identical, output the lines in the same order that they were
3079 input. The log files contain lines that look like this:
3081 4.150.156.3 - - [01/Apr/2004:06:31:51 +0000] message 1
3082 211.24.3.231 - - [24/Apr/2004:20:17:39 +0000] message 2
3084 Fields are separated by exactly one space. Sort IPv4 addresses
3085 lexicographically, e.g., 212.61.52.2 sorts before 212.129.233.201
3086 because 61 is less than 129.
3088 sort -s -t ' ' -k 4.9n -k 4.5M -k 4.2n -k 4.14,4.21 file*.log |
3089 sort -s -t '.' -k 1,1n -k 2,2n -k 3,3n -k 4,4n
3091 This example cannot be done with a single `sort' invocation, since
3092 IPv4 address components are separated by `.' while dates come just
3093 after a space. So it is broken down into two invocations of
3094 `sort': the first sorts by time stamp and the second by IPv4
3095 address. The time stamp is sorted by year, then month, then day,
3096 and finally by hour-minute-second field, using `-k' to isolate each
3097 field. Except for hour-minute-second there's no need to specify
3098 the end of each key field, since the `n' and `M' modifiers sort
3099 based on leading prefixes that cannot cross field boundaries. The
3100 IPv4 addresses are sorted lexicographically. The second sort uses
3101 `-s' so that ties in the primary key are broken by the secondary
3102 key; the first sort uses `-s' so that the combination of the two
3105 * Generate a tags file in case-insensitive sorted order.
3107 find src -type f -print0 | sort -z -f | xargs -0 etags --append
3109 The use of `-print0', `-z', and `-0' in this case means that file
3110 names that contain blanks or other special characters are not
3111 broken up by the sort operation.
3113 * Shuffle a list of directories, but preserve the order of files
3114 within each directory. For instance, one could use this to
3115 generate a music playlist in which albums are shuffled but the
3116 songs of each album are played in order.
3118 ls */* | sort -t / -k 1,1R -k 2,2
3121 ---------- Footnotes ----------
3123 (1) If you use a non-POSIX locale (e.g., by setting `LC_ALL' to
3124 `en_US'), then `sort' may produce output that is sorted differently
3125 than you're accustomed to. In that case, set the `LC_ALL' environment
3126 variable to `C'. Note that setting only `LC_COLLATE' has two problems.
3127 First, it is ineffective if `LC_ALL' is also set. Second, it has
3128 undefined behavior if `LC_CTYPE' (or `LANG', if `LC_CTYPE' is unset) is
3129 set to an incompatible value. For example, you get undefined behavior
3130 if `LC_CTYPE' is `ja_JP.PCK' but `LC_COLLATE' is `en_US.UTF-8'.
3133 File: coreutils.info, Node: shuf invocation, Next: uniq invocation, Prev: sort invocation, Up: Operating on sorted files
3135 7.2 `shuf': Shuffling text
3136 ==========================
3138 `shuf' shuffles its input by outputting a random permutation of its
3139 input lines. Each output permutation is equally likely. Synopses:
3141 shuf [OPTION]... [FILE]
3142 shuf -e [OPTION]... [ARG]...
3143 shuf -i LO-HI [OPTION]...
3145 `shuf' has three modes of operation that affect where it obtains its
3146 input lines. By default, it reads lines from standard input. The
3147 following options change the operation mode:
3151 Treat each command-line operand as an input line.
3154 `--input-range=LO-HI'
3155 Act as if input came from a file containing the range of unsigned
3156 decimal integers LO...HI, one per line.
3159 `shuf''s other options can affect its behavior in all operation
3163 `--head-lines=LINES'
3164 Output at most LINES lines. By default, all input lines are
3168 `--output=OUTPUT-FILE'
3169 Write output to OUTPUT-FILE instead of standard output. `shuf'
3170 reads all input before opening OUTPUT-FILE, so you can safely
3171 shuffle a file in place by using commands like `shuf -o F <F' and
3172 `cat F | shuf -o F'.
3174 `--random-source=FILE'
3175 Use FILE as a source of random data used to determine which
3176 permutation to generate. *Note Random sources::.
3180 Treat the input and output as a set of lines, each terminated by a
3181 zero byte (ASCII NUL (Null) character) instead of an ASCII LF
3182 (Line Feed). This option can be useful in conjunction with `perl
3183 -0' or `find -print0' and `xargs -0' which do the same in order to
3184 reliably handle arbitrary file names (even those containing blanks
3185 or other special characters).
3197 might produce the output
3204 Similarly, the command:
3206 shuf -e clubs hearts diamonds spades
3215 and the command `shuf -i 1-4' might output:
3222 These examples all have four input lines, so `shuf' might produce any
3223 of the twenty-four possible permutations of the input. In general, if
3224 there are N input lines, there are N! (i.e., N factorial, or N * (N -
3225 1) * ... * 1) possible output permutations.
3227 An exit status of zero indicates success, and a nonzero value
3231 File: coreutils.info, Node: uniq invocation, Next: comm invocation, Prev: shuf invocation, Up: Operating on sorted files
3233 7.3 `uniq': Uniquify files
3234 ==========================
3236 `uniq' writes the unique lines in the given `input', or standard input
3237 if nothing is given or for an INPUT name of `-'. Synopsis:
3239 uniq [OPTION]... [INPUT [OUTPUT]]
3241 By default, `uniq' prints its input lines, except that it discards
3242 all but the first of adjacent repeated lines, so that no output lines
3243 are repeated. Optionally, it can instead discard lines that are not
3244 repeated, or all repeated lines.
3246 The input need not be sorted, but repeated input lines are detected
3247 only if they are adjacent. If you want to discard non-adjacent
3248 duplicate lines, perhaps you want to use `sort -u'. *Note sort
3251 Comparisons use the character collating sequence specified by the
3252 `LC_COLLATE' locale category.
3254 If no OUTPUT file is specified, `uniq' writes to standard output.
3256 The program accepts the following options. Also see *Note Common
3261 Skip N fields on each line before checking for uniqueness. Use a
3262 null string for comparison if a line has fewer than N fields.
3263 Fields are sequences of non-space non-tab characters that are
3264 separated from each other by at least one space or tab.
3266 For compatibility `uniq' supports an obsolete option syntax `-N'.
3267 New scripts should use `-f N' instead.
3271 Skip N characters before checking for uniqueness. Use a null
3272 string for comparison if a line has fewer than N characters. If
3273 you use both the field and character skipping options, fields are
3276 On older systems, `uniq' supports an obsolete option syntax `+N'.
3277 This obsolete behavior can be enabled or disabled with the
3278 `_POSIX2_VERSION' environment variable (*note Standards
3279 conformance::), but portable scripts should avoid commands whose
3280 behavior depends on this variable. For example, use `uniq ./+10'
3281 or `uniq -s 10' rather than the ambiguous `uniq +10'.
3285 Print the number of times each line occurred along with the line.
3289 Ignore differences in case when comparing lines.
3293 Discard lines that are not repeated. When used by itself, this
3294 option causes `uniq' to print the first copy of each repeated line,
3298 `--all-repeated[=DELIMIT-METHOD]'
3299 Do not discard the second and subsequent repeated input lines, but
3300 discard lines that are not repeated. This option is useful mainly
3301 in conjunction with other options e.g., to ignore case or to
3302 compare only selected fields. The optional DELIMIT-METHOD tells
3303 how to delimit groups of repeated lines, and must be one of the
3307 Do not delimit groups of repeated lines. This is equivalent
3308 to `--all-repeated' (`-D').
3311 Output a newline before each group of repeated lines.
3314 Separate groups of repeated lines with a single newline.
3315 This is the same as using `prepend', except that there is no
3316 newline before the first group, and hence may be better
3317 suited for output direct to users.
3319 Note that when groups are delimited and the input stream contains
3320 two or more consecutive blank lines, then the output is ambiguous.
3321 To avoid that, filter the input through `tr -s '\n'' to replace
3322 each sequence of consecutive newlines with a single newline.
3324 This is a GNU extension.
3328 Discard the first repeated line. When used by itself, this option
3329 causes `uniq' to print unique lines, and nothing else.
3333 Compare at most N characters on each line (after skipping any
3334 specified fields and characters). By default the entire rest of
3335 the lines are compared.
3338 An exit status of zero indicates success, and a nonzero value
3342 File: coreutils.info, Node: comm invocation, Next: ptx invocation, Prev: uniq invocation, Up: Operating on sorted files
3344 7.4 `comm': Compare two sorted files line by line
3345 =================================================
3347 `comm' writes to standard output lines that are common, and lines that
3348 are unique, to two input files; a file name of `-' means standard
3351 comm [OPTION]... FILE1 FILE2
3353 Before `comm' can be used, the input files must be sorted using the
3354 collating sequence specified by the `LC_COLLATE' locale. If an input
3355 file ends in a non-newline character, a newline is silently appended.
3356 The `sort' command with no options always outputs a file that is
3357 suitable input to `comm'.
3359 With no options, `comm' produces three-column output. Column one
3360 contains lines unique to FILE1, column two contains lines unique to
3361 FILE2, and column three contains lines common to both files. Columns
3362 are separated by a single TAB character.
3364 The options `-1', `-2', and `-3' suppress printing of the
3365 corresponding columns. Also see *Note Common options::.
3367 Unlike some other comparison utilities, `comm' has an exit status
3368 that does not depend on the result of the comparison. Upon normal
3369 completion `comm' produces an exit code of zero. If there is an error
3370 it exits with nonzero status.
3373 File: coreutils.info, Node: tsort invocation, Next: tsort background, Prev: ptx invocation, Up: Operating on sorted files
3375 7.5 `tsort': Topological sort
3376 =============================
3378 `tsort' performs a topological sort on the given FILE, or standard
3379 input if no input file is given or for a FILE of `-'. For more details
3380 and some history, see *Note tsort background::. Synopsis:
3382 tsort [OPTION] [FILE]
3384 `tsort' reads its input as pairs of strings, separated by blanks,
3385 indicating a partial ordering. The output is a total ordering that
3386 corresponds to the given partial ordering.
3397 will produce the output
3406 Consider a more realistic example. You have a large set of
3407 functions all in one file, and they may all be declared static except
3408 one. Currently that one (say `main') is the first function defined in
3409 the file, and the ones it calls directly follow it, followed by those
3410 they call, etc. Let's say that you are determined to take advantage of
3411 prototypes, so you have to choose between declaring all of those
3412 functions (which means duplicating a lot of information from the
3413 definitions) and rearranging the functions so that as many as possible
3414 are defined before they are used. One way to automate the latter
3415 process is to get a list for each function of the functions it calls
3416 directly. Many programs can generate such lists. They describe a call
3417 graph. Consider the following list, in which a given line indicates
3418 that the function on the left calls the one on the right directly.
3423 tail_file pretty_name
3424 tail_file write_header
3426 tail_forever recheck
3427 tail_forever pretty_name
3428 tail_forever write_header
3429 tail_forever dump_remainder
3432 tail_lines start_lines
3433 tail_lines dump_remainder
3434 tail_lines file_lines
3435 tail_lines pipe_lines
3437 tail_bytes start_bytes
3438 tail_bytes dump_remainder
3439 tail_bytes pipe_bytes
3440 file_lines dump_remainder
3443 then you can use `tsort' to produce an ordering of those functions
3444 that satisfies your requirement.
3446 example$ tsort call-graph | tac
3465 `tsort' detects any cycles in the input and writes the first cycle
3466 encountered to standard error.
3468 Note that for a given partial ordering, generally there is no unique
3469 total ordering. In the context of the call graph above, the function
3470 `parse_options' may be placed anywhere in the list as long as it
3473 The only options are `--help' and `--version'. *Note Common
3477 File: coreutils.info, Node: tsort background, Prev: tsort invocation, Up: Operating on sorted files
3479 7.6 `tsort': Background
3480 =======================
3482 `tsort' exists because very early versions of the Unix linker processed
3483 an archive file exactly once, and in order. As `ld' read each object
3484 in the archive, it decided whether it was needed in the program based on
3485 whether it defined any symbols which were undefined at that point in
3488 This meant that dependencies within the archive had to be handled
3489 specially. For example, `scanf' probably calls `read'. That means
3490 that in a single pass through an archive, it was important for `scanf.o'
3491 to appear before read.o, because otherwise a program which calls
3492 `scanf' but not `read' might end up with an unexpected unresolved
3493 reference to `read'.
3495 The way to address this problem was to first generate a set of
3496 dependencies of one object file on another. This was done by a shell
3497 script called `lorder'. The GNU tools don't provide a version of
3498 lorder, as far as I know, but you can still find it in BSD
3501 Then you ran `tsort' over the `lorder' output, and you used the
3502 resulting sort to define the order in which you added objects to the
3505 This whole procedure has been obsolete since about 1980, because
3506 Unix archives now contain a symbol table (traditionally built by
3507 `ranlib', now generally built by `ar' itself), and the Unix linker uses
3508 the symbol table to effectively make multiple passes over an archive
3511 Anyhow, that's where tsort came from. To solve an old problem with
3512 the way the linker handled archive files, which has since been solved
3515 An exit status of zero indicates success, and a nonzero value
3519 File: coreutils.info, Node: ptx invocation, Next: tsort invocation, Prev: comm invocation, Up: Operating on sorted files
3521 7.7 `ptx': Produce permuted indexes
3522 ===================================
3524 `ptx' reads a text file and essentially produces a permuted index, with
3525 each keyword in its context. The calling sketch is either one of:
3527 ptx [OPTION ...] [FILE ...]
3528 ptx -G [OPTION ...] [INPUT [OUTPUT]]
3530 The `-G' (or its equivalent: `--traditional') option disables all
3531 GNU extensions and reverts to traditional mode, thus introducing some
3532 limitations and changing several of the program's default option values.
3533 When `-G' is not specified, GNU extensions are always enabled. GNU
3534 extensions to `ptx' are documented wherever appropriate in this
3535 document. For the full list, see *Note Compatibility in ptx::.
3537 Individual options are explained in the following sections.
3539 When GNU extensions are enabled, there may be zero, one or several
3540 FILEs after the options. If there is no FILE, the program reads the
3541 standard input. If there is one or several FILEs, they give the name
3542 of input files which are all read in turn, as if all the input files
3543 were concatenated. However, there is a full contextual break between
3544 each file and, when automatic referencing is requested, file names and
3545 line numbers refer to individual text input files. In all cases, the
3546 program outputs the permuted index to the standard output.
3548 When GNU extensions are _not_ enabled, that is, when the program
3549 operates in traditional mode, there may be zero, one or two parameters
3550 besides the options. If there are no parameters, the program reads the
3551 standard input and outputs the permuted index to the standard output.
3552 If there is only one parameter, it names the text INPUT to be read
3553 instead of the standard input. If two parameters are given, they give
3554 respectively the name of the INPUT file to read and the name of the
3555 OUTPUT file to produce. _Be very careful_ to note that, in this case,
3556 the contents of file given by the second parameter is destroyed. This
3557 behavior is dictated by System V `ptx' compatibility; GNU Standards
3558 normally discourage output parameters not introduced by an option.
3560 Note that for _any_ file named as the value of an option or as an
3561 input text file, a single dash `-' may be used, in which case standard
3562 input is assumed. However, it would not make sense to use this
3563 convention more than once per program invocation.
3567 * General options in ptx:: Options which affect general program behavior.
3568 * Charset selection in ptx:: Underlying character set considerations.
3569 * Input processing in ptx:: Input fields, contexts, and keyword selection.
3570 * Output formatting in ptx:: Types of output format, and sizing the fields.
3571 * Compatibility in ptx::
3574 File: coreutils.info, Node: General options in ptx, Next: Charset selection in ptx, Up: ptx invocation
3576 7.7.1 General options
3577 ---------------------
3581 As already explained, this option disables all GNU extensions to
3582 `ptx' and switches to traditional mode.
3585 Print a short help on standard output, then exit without further
3589 Print the program version on standard output, then exit without
3593 An exit status of zero indicates success, and a nonzero value
3597 File: coreutils.info, Node: Charset selection in ptx, Next: Input processing in ptx, Prev: General options in ptx, Up: ptx invocation
3599 7.7.2 Charset selection
3600 -----------------------
3602 As it is set up now, the program assumes that the input file is coded
3603 using 8-bit ISO 8859-1 code, also known as Latin-1 character set,
3604 _unless_ it is compiled for MS-DOS, in which case it uses the character
3605 set of the IBM-PC. (GNU `ptx' is not known to work on smaller MS-DOS
3606 machines anymore.) Compared to 7-bit ASCII, the set of characters
3607 which are letters is different; this alters the behavior of regular
3608 expression matching. Thus, the default regular expression for a
3609 keyword allows foreign or diacriticized letters. Keyword sorting,
3610 however, is still crude; it obeys the underlying character set ordering
3615 Fold lower case letters to upper case for sorting.
3619 File: coreutils.info, Node: Input processing in ptx, Next: Output formatting in ptx, Prev: Charset selection in ptx, Up: ptx invocation
3621 7.7.3 Word selection and input processing
3622 -----------------------------------------
3626 This option provides an alternative (to `-W') method of describing
3627 which characters make up words. It introduces the name of a file
3628 which contains a list of characters which can_not_ be part of one
3629 word; this file is called the "Break file". Any character which
3630 is not part of the Break file is a word constituent. If both
3631 options `-b' and `-W' are specified, then `-W' has precedence and
3634 When GNU extensions are enabled, the only way to avoid newline as a
3635 break character is to write all the break characters in the file
3636 with no newline at all, not even at the end of the file. When GNU
3637 extensions are disabled, spaces, tabs and newlines are always
3638 considered as break characters even if not included in the Break
3642 `--ignore-file=FILE'
3643 The file associated with this option contains a list of words
3644 which will never be taken as keywords in concordance output. It
3645 is called the "Ignore file". The file contains exactly one word
3646 in each line; the end of line separation of words is not subject
3647 to the value of the `-S' option.
3651 The file associated with this option contains a list of words
3652 which will be retained in concordance output; any word not
3653 mentioned in this file is ignored. The file is called the "Only
3654 file". The file contains exactly one word in each line; the end
3655 of line separation of words is not subject to the value of the
3658 There is no default for the Only file. When both an Only file and
3659 an Ignore file are specified, a word is considered a keyword only
3660 if it is listed in the Only file and not in the Ignore file.
3664 On each input line, the leading sequence of non-white space
3665 characters will be taken to be a reference that has the purpose of
3666 identifying this input line in the resulting permuted index. For
3667 more information about reference production, see *Note Output
3668 formatting in ptx::. Using this option changes the default value
3671 Using this option, the program does not try very hard to remove
3672 references from contexts in output, but it succeeds in doing so
3673 _when_ the context ends exactly at the newline. If option `-r' is
3674 used with `-S' default value, or when GNU extensions are disabled,
3675 this condition is always met and references are completely
3676 excluded from the output contexts.
3679 `--sentence-regexp=REGEXP'
3680 This option selects which regular expression will describe the end
3681 of a line or the end of a sentence. In fact, this regular
3682 expression is not the only distinction between end of lines or end
3683 of sentences, and input line boundaries have no special
3684 significance outside this option. By default, when GNU extensions
3685 are enabled and if `-r' option is not used, end of sentences are
3686 used. In this case, this REGEX is imported from GNU Emacs:
3688 [.?!][]\"')}]*\\($\\|\t\\| \\)[ \t\n]*
3690 Whenever GNU extensions are disabled or if `-r' option is used, end
3691 of lines are used; in this case, the default REGEXP is just:
3695 Using an empty REGEXP is equivalent to completely disabling end of
3696 line or end of sentence recognition. In this case, the whole file
3697 is considered to be a single big line or sentence. The user might
3698 want to disallow all truncation flag generation as well, through
3699 option `-F ""'. *Note Syntax of Regular Expressions:
3702 When the keywords happen to be near the beginning of the input
3703 line or sentence, this often creates an unused area at the
3704 beginning of the output context line; when the keywords happen to
3705 be near the end of the input line or sentence, this often creates
3706 an unused area at the end of the output context line. The program
3707 tries to fill those unused areas by wrapping around context in
3708 them; the tail of the input line or sentence is used to fill the
3709 unused area on the left of the output line; the head of the input
3710 line or sentence is used to fill the unused area on the right of
3713 As a matter of convenience to the user, many usual backslashed
3714 escape sequences from the C language are recognized and converted
3715 to the corresponding characters by `ptx' itself.
3718 `--word-regexp=REGEXP'
3719 This option selects which regular expression will describe each
3720 keyword. By default, if GNU extensions are enabled, a word is a
3721 sequence of letters; the REGEXP used is `\w+'. When GNU
3722 extensions are disabled, a word is by default anything which ends
3723 with a space, a tab or a newline; the REGEXP used is `[^ \t\n]+'.
3725 An empty REGEXP is equivalent to not using this option. *Note
3726 Syntax of Regular Expressions: (emacs)Regexps.
3728 As a matter of convenience to the user, many usual backslashed
3729 escape sequences, as found in the C language, are recognized and
3730 converted to the corresponding characters by `ptx' itself.
3734 File: coreutils.info, Node: Output formatting in ptx, Next: Compatibility in ptx, Prev: Input processing in ptx, Up: ptx invocation
3736 7.7.4 Output formatting
3737 -----------------------
3739 Output format is mainly controlled by the `-O' and `-T' options
3740 described in the table below. When neither `-O' nor `-T' are selected,
3741 and if GNU extensions are enabled, the program chooses an output format
3742 suitable for a dumb terminal. Each keyword occurrence is output to the
3743 center of one line, surrounded by its left and right contexts. Each
3744 field is properly justified, so the concordance output can be readily
3745 observed. As a special feature, if automatic references are selected
3746 by option `-A' and are output before the left context, that is, if
3747 option `-R' is _not_ selected, then a colon is added after the
3748 reference; this nicely interfaces with GNU Emacs `next-error'
3749 processing. In this default output format, each white space character,
3750 like newline and tab, is merely changed to exactly one space, with no
3751 special attempt to compress consecutive spaces. This might change in
3752 the future. Except for those white space characters, every other
3753 character of the underlying set of 256 characters is transmitted
3756 Output format is further controlled by the following options.
3760 Select the size of the minimum white space gap between the fields
3765 Select the maximum output width of each final line. If references
3766 are used, they are included or excluded from the maximum output
3767 width depending on the value of option `-R'. If this option is not
3768 selected, that is, when references are output before the left
3769 context, the maximum output width takes into account the maximum
3770 length of all references. If this option is selected, that is,
3771 when references are output after the right context, the maximum
3772 output width does not take into account the space taken by
3773 references, nor the gap that precedes them.
3777 Select automatic references. Each input line will have an
3778 automatic reference made up of the file name and the line ordinal,
3779 with a single colon between them. However, the file name will be
3780 empty when standard input is being read. If both `-A' and `-r'
3781 are selected, then the input reference is still read and skipped,
3782 but the automatic reference is used at output time, overriding the
3787 In the default output format, when option `-R' is not used, any
3788 references produced by the effect of options `-r' or `-A' are
3789 placed to the far right of output lines, after the right context.
3790 With default output format, when the `-R' option is specified,
3791 references are rather placed at the beginning of each output line,
3792 before the left context. For any other output format, option `-R'
3793 is ignored, with one exception: with `-R' the width of references
3794 is _not_ taken into account in total output width given by `-w'.
3796 This option is automatically selected whenever GNU extensions are
3800 `--flac-truncation=STRING'
3801 This option will request that any truncation in the output be
3802 reported using the string STRING. Most output fields
3803 theoretically extend towards the beginning or the end of the
3804 current line, or current sentence, as selected with option `-S'.
3805 But there is a maximum allowed output line width, changeable
3806 through option `-w', which is further divided into space for
3807 various output fields. When a field has to be truncated because
3808 it cannot extend beyond the beginning or the end of the current
3809 line to fit in, then a truncation occurs. By default, the string
3810 used is a single slash, as in `-F /'.
3812 STRING may have more than one character, as in `-F ...'. Also, in
3813 the particular case when STRING is empty (`-F ""'), truncation
3814 flagging is disabled, and no truncation marks are appended in this
3817 As a matter of convenience to the user, many usual backslashed
3818 escape sequences, as found in the C language, are recognized and
3819 converted to the corresponding characters by `ptx' itself.
3822 `--macro-name=STRING'
3823 Select another STRING to be used instead of `xx', while generating
3824 output suitable for `nroff', `troff' or TeX.
3828 Choose an output format suitable for `nroff' or `troff'
3829 processing. Each output line will look like:
3831 .xx "TAIL" "BEFORE" "KEYWORD_AND_AFTER" "HEAD" "REF"
3833 so it will be possible to write a `.xx' roff macro to take care of
3834 the output typesetting. This is the default output format when GNU
3835 extensions are disabled. Option `-M' can be used to change `xx'
3836 to another macro name.
3838 In this output format, each non-graphical character, like newline
3839 and tab, is merely changed to exactly one space, with no special
3840 attempt to compress consecutive spaces. Each quote character: `"'
3841 is doubled so it will be correctly processed by `nroff' or `troff'.
3845 Choose an output format suitable for TeX processing. Each output
3846 line will look like:
3848 \xx {TAIL}{BEFORE}{KEYWORD}{AFTER}{HEAD}{REF}
3850 so it will be possible to write a `\xx' definition to take care of
3851 the output typesetting. Note that when references are not being
3852 produced, that is, neither option `-A' nor option `-r' is
3853 selected, the last parameter of each `\xx' call is inhibited.
3854 Option `-M' can be used to change `xx' to another macro name.
3856 In this output format, some special characters, like `$', `%',
3857 `&', `#' and `_' are automatically protected with a backslash.
3858 Curly brackets `{', `}' are protected with a backslash and a pair
3859 of dollar signs (to force mathematical mode). The backslash
3860 itself produces the sequence `\backslash{}'. Circumflex and tilde
3861 diacritical marks produce the sequence `^\{ }' and `~\{ }'
3862 respectively. Other diacriticized characters of the underlying
3863 character set produce an appropriate TeX sequence as far as
3864 possible. The other non-graphical characters, like newline and
3865 tab, and all other characters which are not part of ASCII, are
3866 merely changed to exactly one space, with no special attempt to
3867 compress consecutive spaces. Let me know how to improve this
3868 special character processing for TeX.
3872 File: coreutils.info, Node: Compatibility in ptx, Prev: Output formatting in ptx, Up: ptx invocation
3874 7.7.5 The GNU extensions to `ptx'
3875 ---------------------------------
3877 This version of `ptx' contains a few features which do not exist in
3878 System V `ptx'. These extra features are suppressed by using the `-G'
3879 command line option, unless overridden by other command line options.
3880 Some GNU extensions cannot be recovered by overriding, so the simple
3881 rule is to avoid `-G' if you care about GNU extensions. Here are the
3882 differences between this program and System V `ptx'.
3884 * This program can read many input files at once, it always writes
3885 the resulting concordance on standard output. On the other hand,
3886 System V `ptx' reads only one file and sends the result to
3887 standard output or, if a second FILE parameter is given on the
3888 command, to that FILE.
3890 Having output parameters not introduced by options is a dangerous
3891 practice which GNU avoids as far as possible. So, for using `ptx'
3892 portably between GNU and System V, you should always use it with a
3893 single input file, and always expect the result on standard
3894 output. You might also want to automatically configure in a `-G'
3895 option to `ptx' calls in products using `ptx', if the configurator
3896 finds that the installed `ptx' accepts `-G'.
3898 * The only options available in System V `ptx' are options `-b',
3899 `-f', `-g', `-i', `-o', `-r', `-t' and `-w'. All other options
3900 are GNU extensions and are not repeated in this enumeration.
3901 Moreover, some options have a slightly different meaning when GNU
3902 extensions are enabled, as explained below.
3904 * By default, concordance output is not formatted for `troff' or
3905 `nroff'. It is rather formatted for a dumb terminal. `troff' or
3906 `nroff' output may still be selected through option `-O'.
3908 * Unless `-R' option is used, the maximum reference width is
3909 subtracted from the total output line width. With GNU extensions
3910 disabled, width of references is not taken into account in the
3911 output line width computations.
3913 * All 256 bytes, even null bytes, are always read and processed from
3914 input file with no adverse effect, even if GNU extensions are
3915 disabled. However, System V `ptx' does not accept 8-bit
3916 characters, a few control characters are rejected, and the tilde
3917 `~' is also rejected.
3919 * Input line length is only limited by available memory, even if GNU
3920 extensions are disabled. However, System V `ptx' processes only
3921 the first 200 characters in each line.
3923 * The break (non-word) characters default to be every character
3924 except all letters of the underlying character set, diacriticized
3925 or not. When GNU extensions are disabled, the break characters
3926 default to space, tab and newline only.
3928 * The program makes better use of output line width. If GNU
3929 extensions are disabled, the program rather tries to imitate
3930 System V `ptx', but still, there are some slight disposition
3931 glitches this program does not completely reproduce.
3933 * The user can specify both an Ignore file and an Only file. This
3934 is not allowed with System V `ptx'.
3938 File: coreutils.info, Node: Operating on fields within a line, Next: Operating on characters, Prev: Operating on sorted files, Up: Top
3940 8 Operating on fields within a line
3941 ***********************************
3945 * cut invocation:: Print selected parts of lines.
3946 * paste invocation:: Merge lines of files.
3947 * join invocation:: Join lines on a common field.
3950 File: coreutils.info, Node: cut invocation, Next: paste invocation, Up: Operating on fields within a line
3952 8.1 `cut': Print selected parts of lines
3953 ========================================
3955 `cut' writes to standard output selected parts of each line of each
3956 input file, or standard input if no files are given or for a file name
3959 cut [OPTION]... [FILE]...
3961 In the table which follows, the BYTE-LIST, CHARACTER-LIST, and
3962 FIELD-LIST are one or more numbers or ranges (two numbers separated by
3963 a dash) separated by commas. Bytes, characters, and fields are
3964 numbered starting at 1. Incomplete ranges may be given: `-M' means
3965 `1-M'; `N-' means `N' through end of line or last field. The list
3966 elements can be repeated, can overlap, and can be specified in any
3967 order; but the selected input is written in the same order that it is
3968 read, and is written exactly once.
3970 The program accepts the following options. Also see *Note Common
3975 Select for printing only the bytes in positions listed in
3976 BYTE-LIST. Tabs and backspaces are treated like any other
3977 character; they take up 1 byte. If an output delimiter is
3978 specified, (see the description of `--output-delimiter'), then
3979 output that string between ranges of selected bytes.
3982 `--characters=CHARACTER-LIST'
3983 Select for printing only the characters in positions listed in
3984 CHARACTER-LIST. The same as `-b' for now, but
3985 internationalization will change that. Tabs and backspaces are
3986 treated like any other character; they take up 1 character. If an
3987 output delimiter is specified, (see the description of
3988 `--output-delimiter'), then output that string between ranges of
3992 `--fields=FIELD-LIST'
3993 Select for printing only the fields listed in FIELD-LIST. Fields
3994 are separated by a TAB character by default. Also print any line
3995 that contains no delimiter character, unless the
3996 `--only-delimited' (`-s') option is specified
3998 `-d INPUT_DELIM_BYTE'
3999 `--delimiter=INPUT_DELIM_BYTE'
4000 With `-f', use the first byte of INPUT_DELIM_BYTE as the input
4001 fields separator (default is TAB).
4004 Do not split multi-byte characters (no-op for now).
4008 For `-f', do not print lines that do not contain the field
4009 separator character. Normally, any line without a field separator
4010 is printed verbatim.
4012 `--output-delimiter=OUTPUT_DELIM_STRING'
4013 With `-f', output fields are separated by OUTPUT_DELIM_STRING.
4014 The default with `-f' is to use the input delimiter. When using
4015 `-b' or `-c' to select ranges of byte or character offsets (as
4016 opposed to ranges of fields), output OUTPUT_DELIM_STRING between
4017 non-overlapping ranges of selected bytes.
4020 This option is a GNU extension. Select for printing the
4021 complement of the bytes, characters or fields selected with the
4022 `-b', `-c' or `-f' options. In other words, do _not_ print the
4023 bytes, characters or fields specified via those options. This
4024 option is useful when you have many fields and want to print all
4028 An exit status of zero indicates success, and a nonzero value
4032 File: coreutils.info, Node: paste invocation, Next: join invocation, Prev: cut invocation, Up: Operating on fields within a line
4034 8.2 `paste': Merge lines of files
4035 =================================
4037 `paste' writes to standard output lines consisting of sequentially
4038 corresponding lines of each given file, separated by a TAB character.
4039 Standard input is used for a file name of `-' or if no input files are
4058 paste [OPTION]... [FILE]...
4060 The program accepts the following options. Also see *Note Common
4065 Paste the lines of one file at a time rather than one line from
4066 each file. Using the above example data:
4068 $ paste -s num2 let3
4073 `--delimiters=DELIM-LIST'
4074 Consecutively use the characters in DELIM-LIST instead of TAB to
4075 separate merged lines. When DELIM-LIST is exhausted, start again
4076 at its beginning. Using the above example data:
4078 $ paste -d '%_' num2 let3 num2
4084 An exit status of zero indicates success, and a nonzero value
4088 File: coreutils.info, Node: join invocation, Prev: paste invocation, Up: Operating on fields within a line
4090 8.3 `join': Join lines on a common field
4091 ========================================
4093 `join' writes to standard output a line for each pair of input lines
4094 that have identical join fields. Synopsis:
4096 join [OPTION]... FILE1 FILE2
4098 Either FILE1 or FILE2 (but not both) can be `-', meaning standard
4099 input. FILE1 and FILE2 should be sorted on the join fields.
4101 Normally, the sort order is that of the collating sequence specified
4102 by the `LC_COLLATE' locale. Unless the `-t' option is given, the sort
4103 comparison ignores blanks at the start of the join field, as in `sort
4104 -b'. If the `--ignore-case' option is given, the sort comparison
4105 ignores the case of characters in the join field, as in `sort -f'.
4107 The `sort' and `join' commands should use consistent locales and
4108 options if the output of `sort' is fed to `join'. You can use a
4109 command like `sort -k 1b,1' to sort a file on its default join field,
4110 but if you select a non-default locale, join field, separator, or
4111 comparison options, then you should do so consistently between `join'
4114 As a GNU extension, if the input has no unpairable lines the sort
4115 order can be any order that considers two fields to be equal if and
4116 only if the sort comparison described above considers them to be equal.
4133 * the join field is the first field in each line;
4135 * fields in the input are separated by one or more blanks, with
4136 leading blanks on the line ignored;
4138 * fields in the output are separated by a space;
4140 * each output line consists of the join field, the remaining fields
4141 from FILE1, then the remaining fields from FILE2.
4143 The program accepts the following options. Also see *Note Common
4147 Print a line for each unpairable line in file FILE-NUMBER (either
4148 `1' or `2'), in addition to the normal output.
4151 Replace those output fields that are missing in the input with
4156 Ignore differences in case when comparing keys. With this option,
4157 the lines of the input files must be ordered in the same way. Use
4158 `sort -f' to produce this ordering.
4161 Join on field FIELD (a positive integer) of file 1.
4164 Join on field FIELD (a positive integer) of file 2.
4167 Equivalent to `-1 FIELD -2 FIELD'.
4170 Construct each output line according to the format in FIELD-LIST.
4171 Each element in FIELD-LIST is either the single character `0' or
4172 has the form M.N where the file number, M, is `1' or `2' and N is
4173 a positive field number.
4175 A field specification of `0' denotes the join field. In most
4176 cases, the functionality of the `0' field spec may be reproduced
4177 using the explicit M.N that corresponds to the join field.
4178 However, when printing unpairable lines (using either of the `-a'
4179 or `-v' options), there is no way to specify the join field using
4180 M.N in FIELD-LIST if there are unpairable lines in both files. To
4181 give `join' that functionality, POSIX invented the `0' field
4182 specification notation.
4184 The elements in FIELD-LIST are separated by commas or blanks.
4185 Blank separators typically need to be quoted for the shell. For
4186 example, the commands `join -o 1.2,2.2' and `join -o '1.2 2.2''
4189 All output lines--including those printed because of any -a or -v
4190 option--are subject to the specified FIELD-LIST.
4193 Use character CHAR as the input and output field separator. Treat
4194 as significant each occurrence of CHAR in the input file. Use
4195 `sort -t CHAR', without the `-b' option of `sort', to produce this
4199 Print a line for each unpairable line in file FILE-NUMBER (either
4200 `1' or `2'), instead of the normal output.
4203 An exit status of zero indicates success, and a nonzero value
4207 File: coreutils.info, Node: Operating on characters, Next: Directory listing, Prev: Operating on fields within a line, Up: Top
4209 9 Operating on characters
4210 *************************
4212 This commands operate on individual characters.
4216 * tr invocation:: Translate, squeeze, and/or delete characters.
4217 * expand invocation:: Convert tabs to spaces.
4218 * unexpand invocation:: Convert spaces to tabs.
4221 File: coreutils.info, Node: tr invocation, Next: expand invocation, Up: Operating on characters
4223 9.1 `tr': Translate, squeeze, and/or delete characters
4224 ======================================================
4228 tr [OPTION]... SET1 [SET2]
4230 `tr' copies standard input to standard output, performing one of the
4231 following operations:
4233 * translate, and optionally squeeze repeated characters in the
4236 * squeeze repeated characters,
4238 * delete characters,
4240 * delete characters, then squeeze repeated characters from the
4243 The SET1 and (if given) SET2 arguments define ordered sets of
4244 characters, referred to below as SET1 and SET2. These sets are the
4245 characters of the input that `tr' operates on. The `--complement'
4246 (`-c', `-C') option replaces SET1 with its complement (all of the
4247 characters that are not in SET1).
4249 Currently `tr' fully supports only single-byte characters.
4250 Eventually it will support multibyte characters; when it does, the `-C'
4251 option will cause it to complement the set of characters, whereas `-c'
4252 will cause it to complement the set of values. This distinction will
4253 matter only when some values are not characters, and this is possible
4254 only in locales using multibyte encodings when the input contains
4257 The program accepts the `--help' and `--version' options. *Note
4258 Common options::. Options must precede operands.
4260 An exit status of zero indicates success, and a nonzero value
4265 * Character sets:: Specifying sets of characters.
4266 * Translating:: Changing one set of characters to another.
4267 * Squeezing:: Squeezing repeats and deleting.
4270 File: coreutils.info, Node: Character sets, Next: Translating, Up: tr invocation
4272 9.1.1 Specifying sets of characters
4273 -----------------------------------
4275 The format of the SET1 and SET2 arguments resembles the format of
4276 regular expressions; however, they are not regular expressions, only
4277 lists of characters. Most characters simply represent themselves in
4278 these strings, but the strings can contain the shorthands listed below,
4279 for convenience. Some of them can be used only in SET1 or SET2, as
4283 The following backslash escape sequences are recognized:
4307 The character with the value given by OOO, which is 1 to 3
4313 While a backslash followed by a character not listed above is
4314 interpreted as that character, the backslash also effectively
4315 removes any special significance, so it is useful to escape `[',
4319 The notation `M-N' expands to all of the characters from M through
4320 N, in ascending order. M should collate before N; if it doesn't,
4321 an error results. As an example, `0-9' is the same as
4324 GNU `tr' does not support the System V syntax that uses square
4325 brackets to enclose ranges. Translations specified in that format
4326 sometimes work as expected, since the brackets are often
4327 transliterated to themselves. However, they should be avoided
4328 because they sometimes behave unexpectedly. For example, `tr -d
4329 '[0-9]'' deletes brackets as well as digits.
4331 Many historically common and even accepted uses of ranges are not
4332 portable. For example, on EBCDIC hosts using the `A-Z' range will
4333 not do what most would expect because `A' through `Z' are not
4334 contiguous as they are in ASCII. If you can rely on a POSIX
4335 compliant version of `tr', then the best way to work around this
4336 is to use character classes (see below). Otherwise, it is most
4337 portable (and most ugly) to enumerate the members of the ranges.
4340 The notation `[C*N]' in SET2 expands to N copies of character C.
4341 Thus, `[y*6]' is the same as `yyyyyy'. The notation `[C*]' in
4342 STRING2 expands to as many copies of C as are needed to make SET2
4343 as long as SET1. If N begins with `0', it is interpreted in
4344 octal, otherwise in decimal.
4347 The notation `[:CLASS:]' expands to all of the characters in the
4348 (predefined) class CLASS. The characters expand in no particular
4349 order, except for the `upper' and `lower' classes, which expand in
4350 ascending order. When the `--delete' (`-d') and
4351 `--squeeze-repeats' (`-s') options are both given, any character
4352 class can be used in SET2. Otherwise, only the character classes
4353 `lower' and `upper' are accepted in SET2, and then only if the
4354 corresponding character class (`upper' and `lower', respectively)
4355 is specified in the same relative position in SET1. Doing this
4356 specifies case conversion. The class names are given below; an
4357 error results when an invalid class name is given.
4366 Horizontal whitespace.
4375 Printable characters, not including space.
4381 Printable characters, including space.
4384 Punctuation characters.
4387 Horizontal or vertical whitespace.
4396 The syntax `[=C=]' expands to all of the characters that are
4397 equivalent to C, in no particular order. Equivalence classes are
4398 a relatively recent invention intended to support non-English
4399 alphabets. But there seems to be no standard way to define them
4400 or determine their contents. Therefore, they are not fully
4401 implemented in GNU `tr'; each character's equivalence class
4402 consists only of that character, which is of no particular use.
4406 File: coreutils.info, Node: Translating, Next: Squeezing, Prev: Character sets, Up: tr invocation
4411 `tr' performs translation when SET1 and SET2 are both given and the
4412 `--delete' (`-d') option is not given. `tr' translates each character
4413 of its input that is in SET1 to the corresponding character in SET2.
4414 Characters not in SET1 are passed through unchanged. When a character
4415 appears more than once in SET1 and the corresponding characters in SET2
4416 are not all the same, only the final one is used. For example, these
4417 two commands are equivalent:
4422 A common use of `tr' is to convert lowercase characters to
4423 uppercase. This can be done in many ways. Here are three of them:
4425 tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ
4427 tr '[:lower:]' '[:upper:]'
4429 But note that using ranges like `a-z' above is not portable.
4431 When `tr' is performing translation, SET1 and SET2 typically have
4432 the same length. If SET1 is shorter than SET2, the extra characters at
4433 the end of SET2 are ignored.
4435 On the other hand, making SET1 longer than SET2 is not portable;
4436 POSIX says that the result is undefined. In this situation, BSD `tr'
4437 pads SET2 to the length of SET1 by repeating the last character of SET2
4438 as many times as necessary. System V `tr' truncates SET1 to the length
4441 By default, GNU `tr' handles this case like BSD `tr'. When the
4442 `--truncate-set1' (`-t') option is given, GNU `tr' handles this case
4443 like the System V `tr' instead. This option is ignored for operations
4444 other than translation.
4446 Acting like System V `tr' in this case breaks the relatively common
4449 tr -cs A-Za-z0-9 '\012'
4451 because it converts only zero bytes (the first element in the
4452 complement of SET1), rather than all non-alphanumerics, to newlines.
4454 By the way, the above idiom is not portable because it uses ranges, and
4455 it assumes that the octal code for newline is 012. Assuming a POSIX
4456 compliant `tr', here is a better way to write it:
4458 tr -cs '[:alnum:]' '[\n*]'
4461 File: coreutils.info, Node: Squeezing, Prev: Translating, Up: tr invocation
4463 9.1.3 Squeezing repeats and deleting
4464 ------------------------------------
4466 When given just the `--delete' (`-d') option, `tr' removes any input
4467 characters that are in SET1.
4469 When given just the `--squeeze-repeats' (`-s') option, `tr' replaces
4470 each input sequence of a repeated character that is in SET1 with a
4471 single occurrence of that character.
4473 When given both `--delete' and `--squeeze-repeats', `tr' first
4474 performs any deletions using SET1, then squeezes repeats from any
4475 remaining characters using SET2.
4477 The `--squeeze-repeats' option may also be used when translating, in
4478 which case `tr' first performs translation, then squeezes repeats from
4479 any remaining characters using SET2.
4481 Here are some examples to illustrate various combinations of options:
4483 * Remove all zero bytes:
4487 * Put all words on lines by themselves. This converts all
4488 non-alphanumeric characters to newlines, then squeezes each string
4489 of repeated newlines into a single newline:
4491 tr -cs '[:alnum:]' '[\n*]'
4493 * Convert each sequence of repeated newlines to a single newline:
4497 * Find doubled occurrences of words in a document. For example,
4498 people often write "the the" with the repeated words separated by
4499 a newline. The Bourne shell script below works first by
4500 converting each sequence of punctuation and blank characters to a
4501 single newline. That puts each "word" on a line by itself. Next
4502 it maps all uppercase characters to lower case, and finally it
4503 runs `uniq' with the `-d' option to print out only the words that
4508 | tr -s '[:punct:][:blank:]' '[\n*]' \
4509 | tr '[:upper:]' '[:lower:]' \
4512 * Deleting a small set of characters is usually straightforward.
4513 For example, to remove all `a's, `x's, and `M's you would do this:
4517 However, when `-' is one of those characters, it can be tricky
4518 because `-' has special meanings. Performing the same task as
4519 above but also removing all `-' characters, we might try `tr -d
4520 -axM', but that would fail because `tr' would try to interpret
4521 `-a' as a command-line option. Alternatively, we could try
4522 putting the hyphen inside the string, `tr -d a-xM', but that
4523 wouldn't work either because it would make `tr' interpret `a-x' as
4524 the range of characters `a'...`x' rather than the three. One way
4525 to solve the problem is to put the hyphen at the end of the list
4530 Or you can use `--' to terminate option processing:
4534 More generally, use the character class notation `[=c=]' with `-'
4535 (or any other character) in place of the `c':
4539 Note how single quotes are used in the above example to protect the
4540 square brackets from interpretation by a shell.
4544 File: coreutils.info, Node: expand invocation, Next: unexpand invocation, Prev: tr invocation, Up: Operating on characters
4546 9.2 `expand': Convert tabs to spaces
4547 ====================================
4549 `expand' writes the contents of each given FILE, or standard input if
4550 none are given or for a FILE of `-', to standard output, with tab
4551 characters converted to the appropriate number of spaces. Synopsis:
4553 expand [OPTION]... [FILE]...
4555 By default, `expand' converts all tabs to spaces. It preserves
4556 backspace characters in the output; they decrement the column count for
4557 tab calculations. The default action is equivalent to `-t 8' (set tabs
4560 The program accepts the following options. Also see *Note Common
4564 `--tabs=TAB1[,TAB2]...'
4565 If only one tab stop is given, set the tabs TAB1 spaces apart
4566 (default is 8). Otherwise, set the tabs at columns TAB1, TAB2,
4567 ... (numbered from 0), and replace any tabs beyond the last tab
4568 stop given with single spaces. Tab stops can be separated by
4569 blanks as well as by commas.
4571 For compatibility, GNU `expand' also accepts the obsolete option
4572 syntax, `-T1[,T2]...'. New scripts should use `-t T1[,T2]...'
4577 Only convert initial tabs (those that precede all non-space or
4578 non-tab characters) on each line to spaces.
4581 An exit status of zero indicates success, and a nonzero value
4585 File: coreutils.info, Node: unexpand invocation, Prev: expand invocation, Up: Operating on characters
4587 9.3 `unexpand': Convert spaces to tabs
4588 ======================================
4590 `unexpand' writes the contents of each given FILE, or standard input if
4591 none are given or for a FILE of `-', to standard output, converting
4592 blanks at the beginning of each line into as many tab characters as
4593 needed. In the default POSIX locale, a "blank" is a space or a tab;
4594 other locales may specify additional blank characters. Synopsis:
4596 unexpand [OPTION]... [FILE]...
4598 By default, `unexpand' converts only initial blanks (those that
4599 precede all non-blank characters) on each line. It preserves backspace
4600 characters in the output; they decrement the column count for tab
4601 calculations. By default, tabs are set at every 8th column.
4603 The program accepts the following options. Also see *Note Common
4607 `--tabs=TAB1[,TAB2]...'
4608 If only one tab stop is given, set the tabs TAB1 columns apart
4609 instead of the default 8. Otherwise, set the tabs at columns
4610 TAB1, TAB2, ... (numbered from 0), and leave blanks beyond the tab
4611 stops given unchanged. Tab stops can be separated by blanks as
4612 well as by commas. This option implies the `-a' option.
4614 For compatibility, GNU `unexpand' supports the obsolete option
4615 syntax, `-TAB1[,TAB2]...', where tab stops must be separated by
4616 commas. (Unlike `-t', this obsolete option does not imply `-a'.)
4617 New scripts should use `--first-only -t TAB1[,TAB2]...' instead.
4621 Also convert all sequences of two or more blanks just before a tab
4622 stop, even if they occur after non-blank characters in a line.
4625 An exit status of zero indicates success, and a nonzero value
4629 File: coreutils.info, Node: Directory listing, Next: Basic operations, Prev: Operating on characters, Up: Top
4631 10 Directory listing
4632 ********************
4634 This chapter describes the `ls' command and its variants `dir' and
4635 `vdir', which list information about files.
4639 * ls invocation:: List directory contents.
4640 * dir invocation:: Briefly ls.
4641 * vdir invocation:: Verbosely ls.
4642 * dircolors invocation:: Color setup for ls, etc.
4645 File: coreutils.info, Node: ls invocation, Next: dir invocation, Up: Directory listing
4647 10.1 `ls': List directory contents
4648 ==================================
4650 The `ls' program lists information about files (of any type, including
4651 directories). Options and file arguments can be intermixed
4652 arbitrarily, as usual.
4654 For non-option command-line arguments that are directories, by
4655 default `ls' lists the contents of directories, not recursively, and
4656 omitting files with names beginning with `.'. For other non-option
4657 arguments, by default `ls' lists just the file name. If no non-option
4658 argument is specified, `ls' operates on the current directory, acting
4659 as if it had been invoked with a single argument of `.'.
4661 By default, the output is sorted alphabetically, according to the
4662 locale settings in effect.(1) If standard output is a terminal, the
4663 output is in columns (sorted vertically) and control characters are
4664 output as question marks; otherwise, the output is listed one per line
4665 and control characters are output as-is.
4667 Because `ls' is such a fundamental program, it has accumulated many
4668 options over the years. They are described in the subsections below;
4669 within each section, options are listed alphabetically (ignoring case).
4670 The division of options into the subsections is not absolute, since some
4671 options affect more than one aspect of `ls''s operation.
4676 1 minor problems (e.g., a subdirectory was not found)
4677 2 serious trouble (e.g., memory exhausted)
4679 Also see *Note Common options::.
4683 * Which files are listed::
4684 * What information is listed::
4685 * Sorting the output::
4686 * More details about version sort::
4687 * General output formatting::
4688 * Formatting file timestamps::
4689 * Formatting the file names::
4691 ---------- Footnotes ----------
4693 (1) If you use a non-POSIX locale (e.g., by setting `LC_ALL' to
4694 `en_US'), then `ls' may produce output that is sorted differently than
4695 you're accustomed to. In that case, set the `LC_ALL' environment
4699 File: coreutils.info, Node: Which files are listed, Next: What information is listed, Up: ls invocation
4701 10.1.1 Which files are listed
4702 -----------------------------
4704 These options determine which files `ls' lists information for. By
4705 default, `ls' lists files and the contents of any directories on the
4706 command line, except that in directories it ignores files whose names
4711 In directories, do not ignore file names that start with `.'.
4715 In directories, do not ignore all file names that start with `.';
4716 ignore only `.' and `..'. The `--all' (`-a') option overrides
4721 In directories, ignore files that end with `~'. This option is
4722 equivalent to `--ignore='*~' --ignore='.*~''.
4726 List just the names of directories, as with other types of files,
4727 rather than listing their contents. Do not follow symbolic links
4728 listed on the command line unless the `--dereference-command-line'
4729 (`-H'), `--dereference' (`-L'), or
4730 `--dereference-command-line-symlink-to-dir' options are specified.
4733 `--dereference-command-line'
4734 If a command line argument specifies a symbolic link, show
4735 information for the file the link references rather than for the
4738 `--dereference-command-line-symlink-to-dir'
4739 Do not dereference symbolic links, with one exception: if a
4740 command line argument specifies a symbolic link that refers to a
4741 directory, show information for that directory rather than for the
4742 link itself. This is the default behavior when no other
4743 dereferencing-related option has been specified (`--classify'
4744 (`-F'), `--directory' (`-d'), (`-l'), `--dereference' (`-L'), or
4745 `--dereference-command-line' (`-H')).
4747 `--group-directories-first'
4748 Group all the directories before the files and then sort the
4749 directories and the files separately using the selected sort key
4750 (see -sort option). That is, this option specifies a primary sort
4751 key, and the -sort option specifies a secondary key.
4754 In directories, ignore files whose names match the shell pattern
4755 PATTERN, unless the `--all' (`-a') or `--almost-all' (`-A') is
4756 also given. This option acts like `--ignore=PATTERN' except that
4757 it has no effect if `--all' (`-a') or `--almost-all' (`-A') is
4760 This option can be useful in shell aliases. For example, if `lx'
4761 is an alias for `ls --hide='*~'' and `ly' is an alias for `ls
4762 --ignore='*~'', then the command `lx -A' lists the file `README~'
4763 even though `ly -A' would not.
4767 In directories, ignore files whose names match the shell pattern
4768 (not regular expression) PATTERN. As in the shell, an initial `.'
4769 in a file name does not match a wildcard at the start of PATTERN.
4770 Sometimes it is useful to give this option several times. For
4773 $ ls --ignore='.??*' --ignore='.[^.]' --ignore='#*'
4775 The first option ignores names of length 3 or more that start with
4776 `.', the second ignores all two-character names that start with `.'
4777 except `..', and the third ignores names that start with `#'.
4781 When showing file information for a symbolic link, show information
4782 for the file the link references rather than the link itself.
4783 However, even with this option, `ls' still prints the name of the
4784 link itself, not the name of the file that the link points to.
4788 List the contents of all directories recursively.
4792 File: coreutils.info, Node: What information is listed, Next: Sorting the output, Prev: Which files are listed, Up: ls invocation
4794 10.1.2 What information is listed
4795 ---------------------------------
4797 These options affect the information that `ls' displays. By default,
4798 only file names are shown.
4801 List each file's author when producing long format directory
4802 listings. In GNU/Hurd, file authors can differ from their owners,
4803 but in other operating systems the two are the same.
4807 With the long listing (`-l') format, print an additional line after
4810 //DIRED// BEG1 END1 BEG2 END2 ...
4812 The BEGN and ENDN are unsigned integers that record the byte
4813 position of the beginning and end of each file name in the output.
4814 This makes it easy for Emacs to find the names, even when they
4815 contain unusual characters such as space or newline, without fancy
4818 If directories are being listed recursively (`-R'), output a
4819 similar line with offsets for each subdirectory name:
4821 //SUBDIRED// BEG1 END1 ...
4823 Finally, output a line of the form:
4825 //DIRED-OPTIONS// --quoting-style=WORD
4827 where WORD is the quoting style (*note Formatting the file
4830 Here is an actual example:
4832 $ mkdir -p a/sub/deeper a/sub2
4834 $ touch a/sub/deeper/file
4835 $ ls -gloRF --dired a
4838 -rw-r--r-- 1 0 Jun 10 12:27 f1
4839 -rw-r--r-- 1 0 Jun 10 12:27 f2
4840 drwxr-xr-x 3 4096 Jun 10 12:27 sub/
4841 drwxr-xr-x 2 4096 Jun 10 12:27 sub2/
4845 drwxr-xr-x 2 4096 Jun 10 12:27 deeper/
4849 -rw-r--r-- 1 0 Jun 10 12:27 file
4853 //DIRED// 48 50 84 86 120 123 158 162 217 223 282 286
4854 //SUBDIRED// 2 3 167 172 228 240 290 296
4855 //DIRED-OPTIONS// --quoting-style=literal
4857 Note that the pairs of offsets on the `//DIRED//' line above
4858 delimit these names: `f1', `f2', `sub', `sub2', `deeper', `file'.
4859 The offsets on the `//SUBDIRED//' line delimit the following
4860 directory names: `a', `a/sub', `a/sub/deeper', `a/sub2'.
4862 Here is an example of how to extract the fifth entry name,
4863 `deeper', corresponding to the pair of offsets, 222 and 228:
4865 $ ls -gloRF --dired a > out
4866 $ dd bs=1 skip=222 count=6 < out 2>/dev/null; echo
4869 Note that although the listing above includes a trailing slash for
4870 the `deeper' entry, the offsets select the name without the
4871 trailing slash. However, if you invoke `ls' with `--dired' along
4872 with an option like `--escape' (aka `-b') and operate on a file
4873 whose name contains special characters, notice that the backslash
4877 $ ls -blog --dired 'a b'
4878 -rw-r--r-- 1 0 Jun 10 12:28 a\ b
4880 //DIRED-OPTIONS// --quoting-style=escape
4882 If you use a quoting style that adds quote marks (e.g.,
4883 `--quoting-style=c'), then the offsets include the quote marks.
4884 So beware that the user may select the quoting style via the
4885 environment variable `QUOTING_STYLE'. Hence, applications using
4886 `--dired' should either specify an explicit
4887 `--quoting-style=literal' option (aka `-N' or `--literal') on the
4888 command line, or else be prepared to parse the escaped names.
4891 Produce long format directory listings, and list times in full.
4892 It is equivalent to using `--format=long' with
4893 `--time-style=full-iso' (*note Formatting file timestamps::).
4896 Produce long format directory listings, but don't display owner
4901 Inhibit display of group information in a long format directory
4902 listing. (This is the default in some non-GNU versions of `ls',
4903 so we provide this option for compatibility.)
4907 Append a size letter to each size, such as `M' for mebibytes.
4908 Powers of 1024 are used, not 1000; `M' stands for 1,048,576 bytes.
4909 Use the `--si' option if you prefer powers of 1000.
4913 Print the inode number (also called the file serial number and
4914 index number) of each file to the left of the file name. (This
4915 number uniquely identifies each file within a particular file
4921 In addition to the name of each file, print the file type, file
4922 mode bits, number of hard links, owner name, group name, size, and
4923 timestamp (*note Formatting file timestamps::), normally the
4924 modification time. Print question marks for information that
4925 cannot be determined.
4927 Normally the size is printed as a byte count without punctuation,
4928 but this can be overridden (*note Block size::). For example, `-h'
4929 prints an abbreviated, human-readable count, and
4930 `--block-size="'1"' prints a byte count with the thousands
4931 separator of the current locale.
4933 For each directory that is listed, preface the files with a line
4934 `total BLOCKS', where BLOCKS is the total disk allocation for all
4935 files in that directory. The block size currently defaults to 1024
4936 bytes, but this can be overridden (*note Block size::). The
4937 BLOCKS computed counts each hard link separately; this is arguably
4940 The file type is one of the following characters:
4949 character special file
4952 high performance ("contiguous data") file
4958 door (Solaris 2.5 and up)
4964 off-line ("migrated") file (Cray DMF)
4967 network special file (HP-UX)
4973 port (Solaris 10 and up)
4979 some other file type
4981 The file mode bits listed are similar to symbolic mode
4982 specifications (*note Symbolic Modes::). But `ls' combines
4983 multiple bits into the third character of each set of permissions
4987 If the set-user-ID or set-group-ID bit and the corresponding
4988 executable bit are both set.
4991 If the set-user-ID or set-group-ID bit is set but the
4992 corresponding executable bit is not set.
4995 If the restricted deletion flag or sticky bit, and the
4996 other-executable bit, are both set. The restricted deletion
4997 flag is another name for the sticky bit. *Note Mode
5001 If the restricted deletion flag or sticky bit is set but the
5002 other-executable bit is not set.
5005 If the executable bit is set and none of the above apply.
5010 Following the file mode bits is a single character that specifies
5011 whether an alternate access method such as an access control list
5012 applies to the file. When the character following the file mode
5013 bits is a space, there is no alternate access method. When it is
5014 a printing character, then there is such a method.
5016 For a file with an extended access control list, a `+' character is
5017 listed. Basic access control lists are equivalent to the
5018 permissions listed, and are not considered an alternate access
5023 Produce long format directory listings, but display numeric user
5024 and group IDs instead of the owner and group names.
5027 Produce long format directory listings, but don't display group
5028 information. It is equivalent to using `--format=long' with
5033 Print the disk allocation of each file to the left of the file
5034 name. This is the amount of disk space used by the file, which is
5035 usually a bit more than the file's size, but it can be less if the
5038 Normally the disk allocation is printed in units of 1024 bytes,
5039 but this can be overridden (*note Block size::).
5041 For files that are NFS-mounted from an HP-UX system to a BSD
5042 system, this option reports sizes that are half the correct
5043 values. On HP-UX systems, it reports sizes that are twice the
5044 correct values for files that are NFS-mounted from BSD systems.
5045 This is due to a flaw in HP-UX; it also affects the HP-UX `ls'
5049 Append an SI-style abbreviation to each size, such as `M' for
5050 megabytes. Powers of 1000 are used, not 1024; `M' stands for
5051 1,000,000 bytes. This option is equivalent to `--block-size=si'.
5052 Use the `-h' or `--human-readable' option if you prefer powers of
5057 File: coreutils.info, Node: Sorting the output, Next: More details about version sort, Prev: What information is listed, Up: ls invocation
5059 10.1.3 Sorting the output
5060 -------------------------
5062 These options change the order in which `ls' sorts the information it
5063 outputs. By default, sorting is done by character code (e.g., ASCII
5069 If the long listing format (e.g., `-l', `-o') is being used, print
5070 the status change time (the `ctime' in the inode) instead of the
5071 modification time. When explicitly sorting by time (`--sort=time'
5072 or `-t') or when not using a long listing format, sort according
5073 to the status change time.
5076 Primarily, like `-U'--do not sort; list the files in whatever
5077 order they are stored in the directory. But also enable `-a' (list
5078 all files) and disable `-l', `--color', and `-s' (if they were
5079 specified before the `-f').
5083 Reverse whatever the sorting method is--e.g., list files in reverse
5084 alphabetical order, youngest first, smallest first, or whatever.
5088 Sort by file size, largest first.
5092 Sort by modification time (the `mtime' in the inode), newest first.
5098 If the long listing format (e.g., `--format=long') is being used,
5099 print the last access time (the `atime' in the inode). When
5100 explicitly sorting by time (`--sort=time' or `-t') or when not
5101 using a long listing format, sort according to the access time.
5105 Do not sort; list the files in whatever order they are stored in
5106 the directory. (Do not do any of the other unrelated things that
5107 `-f' does.) This is especially useful when listing very large
5108 directories, since not doing any sorting can be noticeably faster.
5112 Sort by version name and number, lowest first. It behaves like a
5113 default sort, except that each sequence of decimal digits is
5114 treated numerically as an index/version number. (*Note More
5115 details about version sort::.)
5119 Sort directory contents alphabetically by file extension
5120 (characters after the last `.'); files with no extension are
5125 File: coreutils.info, Node: More details about version sort, Next: General output formatting, Prev: Sorting the output, Up: ls invocation
5127 10.1.4 More details about version sort
5128 --------------------------------------
5130 The version sort takes into account the fact that file names frequently
5131 include indices or version numbers. Standard sorting functions usually
5132 do not produce the ordering that people expect because comparisons are
5133 made on a character-by-character basis. The version sort addresses
5134 this problem, and is especially useful when browsing directories that
5135 contain many files with indices/version numbers in their names:
5138 foo.zml-1.gz foo.zml-1.gz
5139 foo.zml-100.gz foo.zml-2.gz
5140 foo.zml-12.gz foo.zml-6.gz
5141 foo.zml-13.gz foo.zml-12.gz
5142 foo.zml-2.gz foo.zml-13.gz
5143 foo.zml-25.gz foo.zml-25.gz
5144 foo.zml-6.gz foo.zml-100.gz
5146 Note also that numeric parts with leading zeros are considered as
5150 abc-1.007.tgz abc-1.007.tgz
5151 abc-1.012b.tgz abc-1.01a.tgz
5152 abc-1.01a.tgz abc-1.012b.tgz
5154 This functionality is implemented using the `strverscmp' function.
5155 *Note String/Array Comparison: (libc)String/Array Comparison. One
5156 result of that implementation decision is that `ls -v' does not use the
5157 locale category, `LC_COLLATE'. As a result, non-numeric prefixes are
5158 sorted as if `LC_COLLATE' were set to `C'.
5161 File: coreutils.info, Node: General output formatting, Next: Formatting file timestamps, Prev: More details about version sort, Up: ls invocation
5163 10.1.5 General output formatting
5164 --------------------------------
5166 These options affect the appearance of the overall output.
5169 `--format=single-column'
5170 List one file per line. This is the default for `ls' when standard
5171 output is not a terminal.
5175 List files in columns, sorted vertically. This is the default for
5176 `ls' if standard output is a terminal. It is always the default
5177 for the `dir' program. GNU `ls' uses variable width columns to
5178 display as many files as possible in the fewest lines.
5181 Specify whether to use color for distinguishing file types. WHEN
5182 may be omitted, or one of:
5183 * none - Do not use color at all. This is the default.
5185 * auto - Only use color if standard output is a terminal.
5187 * always - Always use color.
5188 Specifying `--color' and no WHEN is equivalent to `--color=always'.
5189 Piping a colorized listing through a pager like `more' or `less'
5190 usually produces unreadable results. However, using `more -f'
5195 `--indicator-style=classify'
5196 Append a character to each file name indicating the file type.
5197 Also, for regular files that are executable, append `*'. The file
5198 type indicators are `/' for directories, `@' for symbolic links,
5199 `|' for FIFOs, `=' for sockets, `>' for doors, and nothing for
5200 regular files. Do not follow symbolic links listed on the command
5201 line unless the `--dereference-command-line' (`-H'),
5202 `--dereference' (`-L'), or
5203 `--dereference-command-line-symlink-to-dir' options are specified.
5206 `--indicator-style=file-type'
5207 Append a character to each file name indicating the file type.
5208 This is like `-F', except that executables are not marked.
5210 `--indicator-style=WORD'
5211 Append a character indicator with style WORD to entry names, as
5215 Do not append any character indicator; this is the default.
5218 Append `/' for directories. This is the same as the `-p'
5222 Append `/' for directories, `@' for symbolic links, `|' for
5223 FIFOs, `=' for sockets, and nothing for regular files. This
5224 is the same as the `--file-type' option.
5227 Append `*' for executable regular files, otherwise behave as
5228 for `file-type'. This is the same as the `-F' or
5229 `--classify' option.
5232 Print file sizes in 1024-byte blocks, overriding the default block
5233 size (*note Block size::). This option is equivalent to
5238 List files horizontally, with as many as will fit on each line,
5239 separated by `, ' (a comma and a space).
5242 `--indicator-style=slash'
5243 Append a `/' to directory names.
5247 `--format=horizontal'
5248 List the files in columns, sorted horizontally.
5252 Assume that each tab stop is COLS columns wide. The default is 8.
5253 `ls' uses tabs where possible in the output, for efficiency. If
5254 COLS is zero, do not use tabs at all.
5256 Some terminal emulators (at least Apple Terminal 1.5 (133) from
5257 Mac OS X 10.4.8) do not properly align columns to the right of a
5258 TAB following a non-ASCII byte. If you use such a terminal
5259 emulator, use the `-T0' option or put `TABSIZE=0' in your
5260 environment to tell `ls' to align using spaces, not tabs.
5264 Assume the screen is COLS columns wide. The default is taken from
5265 the terminal settings if possible; otherwise the environment
5266 variable `COLUMNS' is used if it is set; otherwise the default is
5271 File: coreutils.info, Node: Formatting file timestamps, Next: Formatting the file names, Prev: General output formatting, Up: ls invocation
5273 10.1.6 Formatting file timestamps
5274 ---------------------------------
5276 By default, file timestamps are listed in abbreviated form. Most
5277 locales use a timestamp like `2002-03-30 23:45'. However, the default
5278 POSIX locale uses a date like `Mar 30 2002' for non-recent timestamps,
5279 and a date-without-year and time like `Mar 30 23:45' for recent
5282 A timestamp is considered to be "recent" if it is less than six
5283 months old, and is not dated in the future. If a timestamp dated today
5284 is not listed in recent form, the timestamp is in the future, which
5285 means you probably have clock skew problems which may break programs
5286 like `make' that rely on file timestamps.
5288 Time stamps are listed according to the time zone rules specified by
5289 the `TZ' environment variable, or by the system default rules if `TZ'
5290 is not set. *Note Specifying the Time Zone with `TZ': (libc)TZ
5293 The following option changes how file timestamps are printed.
5295 `--time-style=STYLE'
5296 List timestamps in style STYLE. The STYLE should be one of the
5300 List timestamps using FORMAT, where FORMAT is interpreted
5301 like the format argument of `date' (*note date invocation::).
5302 For example, `--time-style="+%Y-%m-%d %H:%M:%S"' causes `ls'
5303 to list timestamps like `2002-03-30 23:45:56'. As with
5304 `date', FORMAT's interpretation is affected by the `LC_TIME'
5307 If FORMAT contains two format strings separated by a newline,
5308 the former is used for non-recent files and the latter for
5309 recent files; if you want output columns to line up, you may
5310 need to insert spaces in one of the two formats.
5313 List timestamps in full using ISO 8601 date, time, and time
5314 zone format with nanosecond precision, e.g., `2002-03-30
5315 23:45:56.477817180 -0700'. This style is equivalent to
5316 `+%Y-%m-%d %H:%M:%S.%N %z'.
5318 This is useful because the time output includes all the
5319 information that is available from the operating system. For
5320 example, this can help explain `make''s behavior, since GNU
5321 `make' uses the full timestamp to determine whether a file is
5325 List ISO 8601 date and time in minutes, e.g., `2002-03-30
5326 23:45'. These timestamps are shorter than `full-iso'
5327 timestamps, and are usually good enough for everyday work.
5328 This style is equivalent to `+%Y-%m-%d %H:%M'.
5331 List ISO 8601 dates for non-recent timestamps (e.g.,
5332 `2002-03-30 '), and ISO 8601 month, day, hour, and minute for
5333 recent timestamps (e.g., `03-30 23:45'). These timestamps
5334 are uglier than `long-iso' timestamps, but they carry nearly
5335 the same information in a smaller space and their brevity
5336 helps `ls' output fit within traditional 80-column output
5337 lines. The following two `ls' invocations are equivalent:
5341 ls -l --time-style="+%Y-%m-%d $newline%m-%d %H:%M"
5342 ls -l --time-style="iso"
5345 List timestamps in a locale-dependent form. For example, a
5346 Finnish locale might list non-recent timestamps like `maalis
5347 30 2002' and recent timestamps like `maalis 30 23:45'.
5348 Locale-dependent timestamps typically consume more space than
5349 `iso' timestamps and are harder for programs to parse because
5350 locale conventions vary so widely, but they are easier for
5351 many people to read.
5353 The `LC_TIME' locale category specifies the timestamp format.
5354 The default POSIX locale uses timestamps like `Mar 30 2002'
5355 and `Mar 30 23:45'; in this locale, the following two `ls'
5356 invocations are equivalent:
5360 ls -l --time-style="+%b %e %Y$newline%b %e %H:%M"
5361 ls -l --time-style="locale"
5363 Other locales behave differently. For example, in a German
5364 locale, `--time-style="locale"' might be equivalent to
5365 `--time-style="+%e. %b %Y $newline%e. %b %H:%M"' and might
5366 generate timestamps like `30. Ma"r 2002 ' and `30. Ma"r
5370 List POSIX-locale timestamps if the `LC_TIME' locale category
5371 is POSIX, STYLE timestamps otherwise. For example, the
5372 `posix-long-iso' style lists timestamps like `Mar 30 2002'
5373 and `Mar 30 23:45' when in the POSIX locale, and like
5374 `2002-03-30 23:45' otherwise.
5376 You can specify the default value of the `--time-style' option with
5377 the environment variable `TIME_STYLE'; if `TIME_STYLE' is not set the
5378 default style is `locale'. GNU Emacs 21.3 and later use the `--dired'
5379 option and therefore can parse any date format, but if you are using
5380 Emacs 21.1 or 21.2 and specify a non-POSIX locale you may need to set
5381 `TIME_STYLE="posix-long-iso"'.
5383 To avoid certain denial-of-service attacks, timestamps that would be
5384 longer than 1000 bytes may be treated as errors.
5387 File: coreutils.info, Node: Formatting the file names, Prev: Formatting file timestamps, Up: ls invocation
5389 10.1.7 Formatting the file names
5390 --------------------------------
5392 These options change how file names themselves are printed.
5396 `--quoting-style=escape'
5397 Quote nongraphic characters in file names using alphabetic and
5398 octal backslash sequences like those used in C.
5402 `--quoting-style=literal'
5403 Do not quote file names. However, with `ls' nongraphic characters
5404 are still printed as question marks if the output is a terminal
5405 and you do not specify the `--show-control-chars' option.
5408 `--hide-control-chars'
5409 Print question marks instead of nongraphic characters in file
5410 names. This is the default if the output is a terminal and the
5416 Enclose file names in double quotes and quote nongraphic
5419 `--quoting-style=WORD'
5420 Use style WORD to quote file names and other strings that may
5421 contain arbitrary characters. The WORD should be one of the
5425 Output strings as-is; this is the same as the `-N' or
5429 Quote strings for the shell if they contain shell
5430 metacharacters or would cause ambiguous output. The quoting
5431 is suitable for POSIX-compatible shells like `bash', but it
5432 does not always work for incompatible shells like `csh'.
5435 Quote strings for the shell, even if they would normally not
5439 Quote strings as for C character string literals, including
5440 the surrounding double-quote characters; this is the same as
5441 the `-Q' or `--quote-name' option.
5444 Quote strings as for C character string literals, except omit
5445 the surrounding double-quote characters; this is the same as
5446 the `-b' or `--escape' option.
5449 Quote strings as for C character string literals, except use
5450 surrounding quotation marks appropriate for the locale.
5453 Quote strings as for C character string literals, except use
5454 surrounding quotation marks appropriate for the locale, and
5455 quote `like this' instead of "like this" in the default C
5456 locale. This looks nicer on many displays.
5458 You can specify the default value of the `--quoting-style' option
5459 with the environment variable `QUOTING_STYLE'. If that environment
5460 variable is not set, the default value is `literal', but this
5461 default may change to `shell' in a future version of this package.
5463 `--show-control-chars'
5464 Print nongraphic characters as-is in file names. This is the
5465 default unless the output is a terminal and the program is `ls'.
5469 File: coreutils.info, Node: dir invocation, Next: vdir invocation, Prev: ls invocation, Up: Directory listing
5471 10.2 `dir': Briefly list directory contents
5472 ===========================================
5474 `dir' is equivalent to `ls -C -b'; that is, by default files are listed
5475 in columns, sorted vertically, and special characters are represented
5476 by backslash escape sequences.
5478 *Note `ls': ls invocation.
5481 File: coreutils.info, Node: vdir invocation, Next: dircolors invocation, Prev: dir invocation, Up: Directory listing
5483 10.3 `vdir': Verbosely list directory contents
5484 ==============================================
5486 `vdir' is equivalent to `ls -l -b'; that is, by default files are
5487 listed in long format and special characters are represented by
5488 backslash escape sequences.
5491 File: coreutils.info, Node: dircolors invocation, Prev: vdir invocation, Up: Directory listing
5493 10.4 `dircolors': Color setup for `ls'
5494 ======================================
5496 `dircolors' outputs a sequence of shell commands to set up the terminal
5497 for color output from `ls' (and `dir', etc.). Typical usage:
5499 eval "`dircolors [OPTION]... [FILE]`"
5501 If FILE is specified, `dircolors' reads it to determine which colors
5502 to use for which file types and extensions. Otherwise, a precompiled
5503 database is used. For details on the format of these files, run
5504 `dircolors --print-database'.
5506 The output is a shell command to set the `LS_COLORS' environment
5507 variable. You can specify the shell syntax to use on the command line,
5508 or `dircolors' will guess it from the value of the `SHELL' environment
5511 The program accepts the following options. Also see *Note Common
5517 Output Bourne shell commands. This is the default if the `SHELL'
5518 environment variable is set and does not end with `csh' or `tcsh'.
5523 Output C shell commands. This is the default if `SHELL' ends with
5528 Print the (compiled-in) default color configuration database. This
5529 output is itself a valid configuration file, and is fairly
5530 descriptive of the possibilities.
5533 An exit status of zero indicates success, and a nonzero value
5537 File: coreutils.info, Node: Basic operations, Next: Special file types, Prev: Directory listing, Up: Top
5542 This chapter describes the commands for basic file manipulation:
5543 copying, moving (renaming), and deleting (removing).
5547 * cp invocation:: Copy files.
5548 * dd invocation:: Convert and copy a file.
5549 * install invocation:: Copy files and set attributes.
5550 * mv invocation:: Move (rename) files.
5551 * rm invocation:: Remove files or directories.
5552 * shred invocation:: Remove files more securely.
5555 File: coreutils.info, Node: cp invocation, Next: dd invocation, Up: Basic operations
5557 11.1 `cp': Copy files and directories
5558 =====================================
5560 `cp' copies files (or, optionally, directories). The copy is
5561 completely independent of the original. You can either copy one file to
5562 another, or copy arbitrarily many files to a destination directory.
5565 cp [OPTION]... [-T] SOURCE DEST
5566 cp [OPTION]... SOURCE... DIRECTORY
5567 cp [OPTION]... -t DIRECTORY SOURCE...
5569 * If two file names are given, `cp' copies the first file to the
5572 * If the `--target-directory' (`-t') option is given, or failing
5573 that if the last file is a directory and the
5574 `--no-target-directory' (`-T') option is not given, `cp' copies
5575 each SOURCE file to the specified directory, using the SOURCEs'
5578 Generally, files are written just as they are read. For exceptions,
5579 see the `--sparse' option below.
5581 By default, `cp' does not copy directories. However, the `-R',
5582 `-a', and `-r' options cause `cp' to copy recursively by descending
5583 into source directories and copying files to corresponding destination
5586 By default, `cp' follows symbolic links only when not copying
5587 recursively. This default can be overridden with the `--archive'
5588 (`-a'), `-d', `--dereference' (`-L'), `--no-dereference' (`-P'), and
5589 `-H' options. If more than one of these options is specified, the last
5590 one silently overrides the others.
5592 By default, `cp' copies the contents of special files only when not
5593 copying recursively. This default can be overridden with the
5594 `--copy-contents' option.
5596 `cp' generally refuses to copy a file onto itself, with the
5597 following exception: if `--force --backup' is specified with SOURCE and
5598 DEST identical, and referring to a regular file, `cp' will make a
5599 backup file, either regular or numbered, as specified in the usual ways
5600 (*note Backup options::). This is useful when you simply want to make
5601 a backup of an existing file before changing it.
5603 The program accepts the following options. Also see *Note Common
5608 Preserve as much as possible of the structure and attributes of the
5609 original files in the copy (but do not attempt to preserve internal
5610 directory structure; i.e., `ls -U' may list the entries in a copied
5611 directory in a different order). Equivalent to `-dpPR'.
5615 *Note Backup options::. Make a backup of each file that would
5616 otherwise be overwritten or removed. As a special case, `cp'
5617 makes a backup of SOURCE when the force and backup options are
5618 given and SOURCE and DEST are the same name for an existing,
5619 regular file. One useful application of this combination of
5620 options is this tiny Bourne shell script:
5623 # Usage: backup FILE...
5624 # Create a GNU-style backup of each listed FILE.
5626 cp --backup --force -- "$i" "$i"
5630 If copying recursively, copy the contents of any special files
5631 (e.g., FIFOs and device files) as if they were regular files.
5632 This means trying to read the data in each source file and writing
5633 it to the destination. It is usually a mistake to use this
5634 option, as it normally has undesirable effects on special files
5635 like FIFOs and the ones typically found in the `/dev' directory.
5636 In most cases, `cp -R --copy-contents' will hang indefinitely
5637 trying to read from FIFOs and special files like `/dev/console',
5638 and it will fill up your destination disk if you use it to copy
5639 `/dev/zero'. This option has no effect unless copying
5640 recursively, and it does not affect the copying of symbolic links.
5643 Copy symbolic links as symbolic links rather than copying the
5644 files that they point to, and preserve hard links between source
5645 files in the copies. Equivalent to `--no-dereference
5650 When copying without this option and an existing destination file
5651 cannot be opened for writing, the copy fails. However, with
5652 `--force'), when a destination file cannot be opened, `cp' then
5653 unlinks it and tries to open it again. Contrast this behavior
5654 with that enabled by `--link' and `--symbolic-link', whereby the
5655 destination file is never opened but rather is unlinked
5656 unconditionally. Also see the description of
5657 `--remove-destination'.
5659 This option is independent of the `--interactive' or `-i' option:
5660 neither cancels the effect of the other.
5663 If a command line argument specifies a symbolic link, then copy the
5664 file it points to rather than the symbolic link itself. However,
5665 copy (preserving its nature) any symbolic link that is encountered
5666 via recursive traversal.
5670 When copying a file other than a directory, prompt whether to
5671 overwrite an existing destination file.
5675 Make hard links instead of copies of non-directories.
5679 Always follow symbolic links.
5683 Copy symbolic links as symbolic links rather than copying the
5684 files that they point to.
5687 `--preserve[=ATTRIBUTE_LIST]'
5688 Preserve the specified attributes of the original files. If
5689 specified, the ATTRIBUTE_LIST must be a comma-separated list of
5690 one or more of the following strings:
5693 Preserve the file mode bits and access control lists.
5696 Preserve the owner and group. On most modern systems, only
5697 users with appropriate privileges may change the owner of a
5698 file, and ordinary users may preserve the group ownership of
5699 a file only if they happen to be a member of the desired
5703 Preserve the times of last access and last modification, when
5704 possible. In general, it is not possible to preserve these
5705 attributes when the affected file is a symbolic link.
5706 However, FreeBSD now provides the `lutimes' function, which
5707 makes it possibile even for symbolic links. However, this
5708 implementation does not yet take advantage of that.
5711 Preserve in the destination files any links between
5712 corresponding source files.
5715 Preserve all file attributes. Equivalent to specifying all
5718 Using `--preserve' with no ATTRIBUTE_LIST is equivalent to
5719 `--preserve=mode,ownership,timestamps'.
5721 In the absence of this option, each destination file is created
5722 with the mode bits of the corresponding source file, minus the
5723 bits set in the umask and minus the set-user-ID and set-group-ID
5724 bits. *Note File permissions::.
5726 `--no-preserve=ATTRIBUTE_LIST'
5727 Do not preserve the specified attributes. The ATTRIBUTE_LIST has
5728 the same form as for `--preserve'.
5731 Form the name of each destination file by appending to the target
5732 directory a slash and the specified name of the source file. The
5733 last argument given to `cp' must be the name of an existing
5734 directory. For example, the command:
5736 cp --parents a/b/c existing_dir
5738 copies the file `a/b/c' to `existing_dir/a/b/c', creating any
5739 missing intermediate directories.
5742 *Deprecated: to be removed in 2008.*
5743 Using `--reply=yes' makes `cp' act as if `yes' were given as a
5744 response to every prompt about a destination file. That
5745 effectively cancels any preceding `--interactive' or `-i' option.
5746 Specify `--reply=no' to make `cp' act as if `no' were given as a
5747 response to every prompt about a destination file. Specify
5748 `--reply=query' to make `cp' prompt the user about each existing
5754 Copy directories recursively. Symbolic links are not followed by
5755 default; see the `--archive' (`-a'), `-d', `--dereference' (`-L'),
5756 `--no-dereference' (`-P'), and `-H' options. Special files are
5757 copied by creating a destination file of the same type as the
5758 source; see the `--copy-contents' option. It is not portable to
5759 use `-r' to copy symbolic links or special files. On some non-GNU
5760 systems, `-r' implies the equivalent of `-L' and `--copy-contents'
5761 for historical reasons. Also, it is not portable to use `-R' to
5762 copy symbolic links unless you also specify `-P', as POSIX allows
5763 implementations that dereference symbolic links by default.
5765 `--remove-destination'
5766 Remove each existing destination file before attempting to open it
5767 (contrast with `-f' above).
5770 A "sparse file" contains "holes"--a sequence of zero bytes that
5771 does not occupy any physical disk blocks; the `read' system call
5772 reads these as zeros. This can both save considerable disk space
5773 and increase speed, since many binary files contain lots of
5774 consecutive zero bytes. By default, `cp' detects holes in input
5775 source files via a crude heuristic and makes the corresponding
5776 output file sparse as well. Only regular files may be sparse.
5778 The WHEN value can be one of the following:
5781 The default behavior: if the input file is sparse, attempt to
5782 make the output file sparse, too. However, if an output file
5783 exists but refers to a non-regular file, then do not attempt
5787 For each sufficiently long sequence of zero bytes in the
5788 input file, attempt to create a corresponding hole in the
5789 output file, even if the input file does not appear to be
5790 sparse. This is useful when the input file resides on a file
5791 system that does not support sparse files (for example,
5792 `efs' file systems in SGI IRIX 5.3 and earlier), but the
5793 output file is on a type of file system that does support
5794 them. Holes may be created only in regular files, so if the
5795 destination file is of some other type, `cp' does not even
5796 try to make it sparse.
5799 Never make the output file sparse. This is useful in
5800 creating a file for use with the `mkswap' command, since such
5801 a file must not have any holes.
5803 `--strip-trailing-slashes'
5804 Remove any trailing slashes from each SOURCE argument. *Note
5809 Make symbolic links instead of copies of non-directories. All
5810 source file names must be absolute (starting with `/') unless the
5811 destination files are in the current directory. This option merely
5812 results in an error message on systems that do not support
5817 Append SUFFIX to each backup file made with `-b'. *Note Backup
5821 `--target-directory=DIRECTORY'
5822 Specify the destination DIRECTORY. *Note Target directory::.
5825 `--no-target-directory'
5826 Do not treat the last operand specially when it is a directory or a
5827 symbolic link to a directory. *Note Target directory::.
5831 Do not copy a non-directory that has an existing destination with
5832 the same or newer modification time. If time stamps are being
5833 preserved, the comparison is to the source time stamp truncated to
5834 the resolutions of the destination file system and of the system
5835 calls used to update time stamps; this avoids duplicate work if
5836 several `cp -pu' commands are executed with the same source and
5841 Print the name of each file before copying it.
5845 Skip subdirectories that are on different file systems from the
5846 one that the copy started on. However, mount point directories
5850 An exit status of zero indicates success, and a nonzero value
5854 File: coreutils.info, Node: dd invocation, Next: install invocation, Prev: cp invocation, Up: Basic operations
5856 11.2 `dd': Convert and copy a file
5857 ==================================
5859 `dd' copies a file (from standard input to standard output, by default)
5860 with a changeable I/O block size, while optionally performing
5861 conversions on it. Synopses:
5866 The only options are `--help' and `--version'. *Note Common
5867 options::. `dd' accepts the following operands.
5870 Read from FILE instead of standard input.
5873 Write to FILE instead of standard output. Unless `conv=notrunc'
5874 is given, `dd' truncates FILE to zero bytes (or the size specified
5878 Set the input block size to BYTES. This makes `dd' read BYTES per
5882 Set the output block size to BYTES. This makes `dd' write BYTES
5886 Set both input and output block sizes to BYTES. This makes `dd'
5887 read and write BYTES per block, overriding any `ibs' and `obs'
5891 Set the conversion block size to BYTES. When converting
5892 variable-length records to fixed-length ones (`conv=block') or the
5893 reverse (`conv=unblock'), use BYTES as the fixed record length.
5896 Skip BLOCKS `ibs'-byte blocks in the input file before copying.
5899 Skip BLOCKS `obs'-byte blocks in the output file before copying.
5902 Copy BLOCKS `ibs'-byte blocks from the input file, instead of
5903 everything until the end of the file.
5905 `conv=CONVERSION[,CONVERSION]...'
5906 Convert the file as specified by the CONVERSION argument(s). (No
5907 spaces around any comma(s).)
5912 Convert EBCDIC to ASCII, using the conversion table specified
5913 by POSIX. This provides a 1:1 translation for all 256 bytes.
5916 Convert ASCII to EBCDIC. This is the inverse of the `ascii'
5920 Convert ASCII to alternate EBCDIC, using the alternate
5921 conversion table specified by POSIX. This is not a 1:1
5922 translation, but reflects common historical practice for `~',
5925 The `ascii', `ebcdic', and `ibm' conversions are mutually
5929 For each line in the input, output `cbs' bytes, replacing the
5930 input newline with a space and padding with spaces as
5934 Replace trailing spaces in each `cbs'-sized input block with a
5937 The `block' and `unblock' conversions are mutually exclusive.
5940 Change uppercase letters to lowercase.
5943 Change lowercase letters to uppercase.
5945 The `lcase' and `ucase' conversions are mutually exclusive.
5948 Swap every pair of input bytes. GNU `dd', unlike others,
5949 works when an odd number of bytes are read--the last byte is
5950 simply copied (since there is nothing to swap it with).
5953 Continue after read errors.
5956 Do not create the output file; the output file must already
5960 Fail if the output file already exists; `dd' must create the
5963 The `excl' and `nocreat' conversions are mutually exclusive.
5966 Do not truncate the output file.
5969 Pad every input block to size of `ibs' with trailing zero
5970 bytes. When used with `block' or `unblock', pad with spaces
5971 instead of zero bytes.
5974 Synchronize output data just before finishing. This forces a
5975 physical write of output data.
5978 Synchronize output data and metadata just before finishing.
5979 This forces a physical write of output data and metadata.
5982 `iflag=FLAG[,FLAG]...'
5983 Access the input file using the flags specified by the FLAG
5984 argument(s). (No spaces around any comma(s).)
5986 `oflag=FLAG[,FLAG]...'
5987 Access the output file using the flags specified by the FLAG
5988 argument(s). (No spaces around any comma(s).)
5990 Here are the flags. Not every flag is supported on every operating
5994 Write in append mode, so that even if some other process is
5995 writing to this file, every `dd' write will append to the
5996 current contents of the file. This flag makes sense only for
5997 output. If you combine this flag with the `of=FILE' operand,
5998 you should also specify `conv=notrunc' unless you want the
5999 output file to be truncated before being appended to.
6002 Use direct I/O for data, avoiding the buffer cache.
6005 Fail unless the file is a directory. Most operating systems
6006 do not allow I/O to a directory, so this flag has limited
6010 Use synchronized I/O for data. For the output file, this
6011 forces a physical write of output data on each write. For
6012 the input file, this flag can matter when reading from a
6013 remote file that has been written to synchronously by some
6014 other process. Metadata (e.g., last-access and last-modified
6015 time) is not necessarily synchronized.
6018 Use synchronized I/O for both data and metadata.
6021 Use non-blocking I/O.
6024 Do not update the file's access time. Some older file
6025 systems silently ignore this flag, so it is a good idea to
6026 test it on your files before relying on it.
6029 Do not assign the file to be a controlling terminal for `dd'.
6030 This has no effect when the file is not a terminal. On many
6031 hosts (e.g., GNU/Linux hosts), this option has no effect at
6035 Do not follow symbolic links.
6038 Fail if the file has multiple hard links.
6041 Use binary I/O. This option has an effect only on nonstandard
6042 platforms that distinguish binary from text I/O.
6045 Use text I/O. Like `binary', this option has no effect on
6049 These flags are not supported on all systems, and `dd' rejects
6050 attempts to use them when they are not supported. When reading
6051 from standard input or writing to standard output, the `nofollow'
6052 and `noctty' flags should not be specified, and the other flags
6053 (e.g., `nonblock') can affect how other processes behave with the
6054 affected file descriptors, even after `dd' exits.
6057 The numeric-valued strings above (BYTES and BLOCKS) can be followed
6058 by a multiplier: `b'=512, `c'=1, `w'=2, `xM'=M, or any of the standard
6059 block size suffixes like `k'=1024 (*note Block size::).
6061 Use different `dd' invocations to use different block sizes for
6062 skipping and I/O. For example, the following shell commands copy data
6063 in 512 KiB blocks between a disk and a tape, but do not save or restore
6064 a 4 KiB label at the start of the disk:
6066 disk=/dev/rdsk/c0t1d0s2
6069 # Copy all but the label from disk to tape.
6070 (dd bs=4k skip=1 count=0 && dd bs=512k) <$disk >$tape
6072 # Copy from tape back to disk, but leave the disk label alone.
6073 (dd bs=4k seek=1 count=0 && dd bs=512k) <$tape >$disk
6075 Sending an `INFO' signal to a running `dd' process makes it print
6076 I/O statistics to standard error and then resume copying. In the
6077 example below, `dd' is run in the background to copy 10 million blocks.
6078 The `kill' command makes it output intermediate I/O statistics, and
6079 when `dd' completes, it outputs the final statistics.
6081 $ dd if=/dev/zero of=/dev/null count=10MB & pid=$!
6082 $ kill -s INFO $pid; wait $pid
6083 3385223+0 records in
6084 3385223+0 records out
6085 1733234176 bytes (1.7 GB) copied, 6.42173 seconds, 270 MB/s
6086 10000000+0 records in
6087 10000000+0 records out
6088 5120000000 bytes (5.1 GB) copied, 18.913 seconds, 271 MB/s
6090 On systems lacking the `INFO' signal `dd' responds to the `USR1'
6091 signal instead, unless the `POSIXLY_CORRECT' environment variable is
6094 An exit status of zero indicates success, and a nonzero value
6098 File: coreutils.info, Node: install invocation, Next: mv invocation, Prev: dd invocation, Up: Basic operations
6100 11.3 `install': Copy files and set attributes
6101 =============================================
6103 `install' copies files while setting their file mode bits and, if
6104 possible, their owner and group. Synopses:
6106 install [OPTION]... [-T] SOURCE DEST
6107 install [OPTION]... SOURCE... DIRECTORY
6108 install [OPTION]... -t DIRECTORY SOURCE...
6109 install [OPTION]... -d DIRECTORY...
6111 * If two file names are given, `install' copies the first file to the
6114 * If the `--target-directory' (`-t') option is given, or failing
6115 that if the last file is a directory and the
6116 `--no-target-directory' (`-T') option is not given, `install'
6117 copies each SOURCE file to the specified directory, using the
6120 * If the `--directory' (`-d') option is given, `install' creates
6121 each DIRECTORY and any missing parent directories. Parent
6122 directories are created with mode `u=rwx,go=rx' (755), regardless
6123 of the `-m' option or the current umask. *Note Directory Setuid
6124 and Setgid::, for how the set-user-ID and set-group-ID bits of
6125 parent directories are inherited.
6127 `install' is similar to `cp', but allows you to control the
6128 attributes of destination files. It is typically used in Makefiles to
6129 copy programs into their destination directories. It refuses to copy
6130 files onto themselves.
6132 The program accepts the following options. Also see *Note Common
6137 *Note Backup options::. Make a backup of each file that would
6138 otherwise be overwritten or removed.
6141 Ignored; for compatibility with old Unix versions of `install'.
6145 Create any missing parent directories, giving them the default
6146 attributes. Then create each given directory, setting their owner,
6147 group and mode as given on the command line or to the defaults.
6151 Set the group ownership of installed files or directories to
6152 GROUP. The default is the process's current group. GROUP may be
6153 either a group name or a numeric group ID.
6157 Set the file mode bits for the installed file or directory to MODE,
6158 which can be either an octal number, or a symbolic mode as in
6159 `chmod', with `a=' (no access allowed to anyone) as the point of
6160 departure (*note File permissions::). The default mode is
6161 `u=rwx,go=rx,a-s'--read, write, and execute for the owner, read
6162 and execute for group and other, and with set-user-ID and
6163 set-group-ID disabled. This default is not quite the same as
6164 `755', since it disables instead of preserving set-user-ID and
6165 set-group-ID on directories. *Note Directory Setuid and Setgid::.
6169 If `install' has appropriate privileges (is run as root), set the
6170 ownership of installed files or directories to OWNER. The default
6171 is `root'. OWNER may be either a user name or a numeric user ID.
6174 `--preserve-timestamps'
6175 Set the time of last access and the time of last modification of
6176 each installed file to match those of each corresponding original
6177 file. When a file is installed without this option, its last
6178 access and last modification times are both set to the time of
6179 installation. This option is useful if you want to use the last
6180 modification times of installed files to keep track of when they
6181 were last built as opposed to when they were last installed.
6185 Strip the symbol tables from installed binary executables.
6189 Append SUFFIX to each backup file made with `-b'. *Note Backup
6193 `--target-directory=DIRECTORY'
6194 Specify the destination DIRECTORY. *Note Target directory::.
6197 `--no-target-directory'
6198 Do not treat the last operand specially when it is a directory or a
6199 symbolic link to a directory. *Note Target directory::.
6203 Print the name of each file before copying it.
6206 An exit status of zero indicates success, and a nonzero value
6210 File: coreutils.info, Node: mv invocation, Next: rm invocation, Prev: install invocation, Up: Basic operations
6212 11.4 `mv': Move (rename) files
6213 ==============================
6215 `mv' moves or renames files (or directories). Synopses:
6217 mv [OPTION]... [-T] SOURCE DEST
6218 mv [OPTION]... SOURCE... DIRECTORY
6219 mv [OPTION]... -t DIRECTORY SOURCE...
6221 * If two file names are given, `mv' moves the first file to the
6224 * If the `--target-directory' (`-t') option is given, or failing
6225 that if the last file is a directory and the
6226 `--no-target-directory' (`-T') option is not given, `mv' moves
6227 each SOURCE file to the specified directory, using the SOURCEs'
6230 `mv' can move any type of file from one file system to another.
6231 Prior to version `4.0' of the fileutils, `mv' could move only regular
6232 files between file systems. For example, now `mv' can move an entire
6233 directory hierarchy including special device files from one partition
6234 to another. It first uses some of the same code that's used by `cp -a'
6235 to copy the requested directories and files, then (assuming the copy
6236 succeeded) it removes the originals. If the copy fails, then the part
6237 that was copied to the destination partition is removed. If you were
6238 to copy three directories from one partition to another and the copy of
6239 the first directory succeeded, but the second didn't, the first would
6240 be left on the destination partition and the second and third would be
6241 left on the original partition.
6243 If a destination file exists but is normally unwritable, standard
6244 input is a terminal, and the `-f' or `--force' option is not given,
6245 `mv' prompts the user for whether to replace the file. (You might own
6246 the file, or have write permission on its directory.) If the response
6247 is not affirmative, the file is skipped.
6249 _Warning_: If you try to move a symlink that points to a directory,
6250 and you specify the symlink with a trailing slash, then `mv' doesn't
6251 move the symlink but instead moves the directory referenced by the
6252 symlink. *Note Trailing slashes::.
6254 The program accepts the following options. Also see *Note Common
6259 *Note Backup options::. Make a backup of each file that would
6260 otherwise be overwritten or removed.
6264 Do not prompt the user before removing a destination file.
6268 Prompt whether to overwrite each existing destination file,
6269 regardless of its permissions. If the response is not
6270 affirmative, the file is skipped.
6273 *Deprecated: to be removed in 2008.*
6274 Specifying `--reply=yes' is equivalent to using `--force'.
6275 Specify `--reply=no' to make `mv' act as if `no' were given as a
6276 response to every prompt about a destination file. Specify
6277 `--reply=query' to make `mv' prompt the user about each existing
6278 destination file. Note that `--reply=no' has an effect only when
6279 `mv' would prompt without `-i' or equivalent, i.e., when a
6280 destination file exists and is not writable, standard input is a
6281 terminal, and no `-f' (or equivalent) option is specified.
6285 Do not move a non-directory that has an existing destination with
6286 the same or newer modification time. If the move is across file
6287 system boundaries, the comparison is to the source time stamp
6288 truncated to the resolutions of the destination file system and of
6289 the system calls used to update time stamps; this avoids duplicate
6290 work if several `mv -u' commands are executed with the same source
6295 Print the name of each file before moving it.
6297 `--strip-trailing-slashes'
6298 Remove any trailing slashes from each SOURCE argument. *Note
6303 Append SUFFIX to each backup file made with `-b'. *Note Backup
6307 `--target-directory=DIRECTORY'
6308 Specify the destination DIRECTORY. *Note Target directory::.
6311 `--no-target-directory'
6312 Do not treat the last operand specially when it is a directory or a
6313 symbolic link to a directory. *Note Target directory::.
6316 An exit status of zero indicates success, and a nonzero value
6320 File: coreutils.info, Node: rm invocation, Next: shred invocation, Prev: mv invocation, Up: Basic operations
6322 11.5 `rm': Remove files or directories
6323 ======================================
6325 `rm' removes each given FILE. By default, it does not remove
6326 directories. Synopsis:
6328 rm [OPTION]... [FILE]...
6330 If the `-I' or `--interactive=once' option is given, and there are
6331 more than three files or the `-r', `-R', or `--recursive' are given,
6332 then `rm' prompts the user for whether to proceed with the entire
6333 operation. If the response is not affirmative, the entire command is
6336 Otherwise, if a file is unwritable, standard input is a terminal, and
6337 the `-f' or `--force' option is not given, or the `-i' or
6338 `--interactive=always' option _is_ given, `rm' prompts the user for
6339 whether to remove the file. If the response is not affirmative, the
6342 Any attempt to remove a file whose last file name component is `.'
6343 or `..' is rejected without any prompting.
6345 _Warning_: If you use `rm' to remove a file, it is usually possible
6346 to recover the contents of that file. If you want more assurance that
6347 the contents are truly unrecoverable, consider using `shred'.
6349 The program accepts the following options. Also see *Note Common
6354 Ignore nonexistent files and never prompt the user. Ignore any
6355 previous `--interactive' (`-i') option.
6358 Prompt whether to remove each file. If the response is not
6359 affirmative, the file is skipped. Ignore any previous `--force'
6360 (`-f') option. Equivalent to `--interactive=always'.
6363 Prompt once whether to proceed with the command, if more than three
6364 files are named or if a recursive removal is requested. Ignore any
6365 previous `--force' (`-f') option. Equivalent to
6366 `--interactive=once'.
6368 `--interactive [=WHEN]'
6369 Specify when to issue an interactive prompt. WHEN may be omitted,
6371 * never - Do not prompt at all.
6373 * once - Prompt once if more than three files are named or if a
6374 recursive removal is requested. Equivalent to `-I'.
6376 * always - Prompt for every file being removed. Equivalent to
6378 Specifying `--interactive' and no WHEN is equivalent to
6379 `--interactive=always'.
6382 When removing a hierarchy recursively, skip any directory that is
6383 on a file system different from that of the corresponding command
6386 This option is useful when removing a build "chroot" hierarchy,
6387 which normally contains no valuable data. However, it is not
6388 uncommon to bind-mount `/home' into such a hierarchy, to make it
6389 easier to use one's start-up file. The catch is that it's easy to
6390 forget to unmount `/home'. Then, when you use `rm -rf' to remove
6391 your normally throw-away chroot, that command will remove
6392 everything under `/home', too. Use the `--one-file-system'
6393 option, and it will warn about and skip directories on other file
6394 systems. Of course, this will not save your `/home' if it and your
6395 chroot happen to be on the same file system.
6398 Fail upon any attempt to remove the root directory, `/', when used
6399 with the `--recursive' option. This is the default behavior.
6400 *Note Treating / specially::.
6402 `--no-preserve-root'
6403 Do not treat `/' specially when removing recursively. This option
6404 is not recommended unless you really want to remove all the files
6405 on your computer. *Note Treating / specially::.
6410 Remove the listed directories and their contents recursively.
6414 Print the name of each file before removing it.
6417 One common question is how to remove files whose names begin with a
6418 `-'. GNU `rm', like every program that uses the `getopt' function to
6419 parse its arguments, lets you use the `--' option to indicate that all
6420 following arguments are non-options. To remove a file called `-f' in
6421 the current directory, you could type either:
6429 The Unix `rm' program's use of a single `-' for this purpose
6430 predates the development of the getopt standard syntax.
6432 An exit status of zero indicates success, and a nonzero value
6436 File: coreutils.info, Node: shred invocation, Prev: rm invocation, Up: Basic operations
6438 11.6 `shred': Remove files more securely
6439 ========================================
6441 `shred' overwrites devices or files, to help prevent even very
6442 expensive hardware from recovering the data.
6444 Ordinarily when you remove a file (*note rm invocation::), the data
6445 is not actually destroyed. Only the index listing where the file is
6446 stored is destroyed, and the storage is made available for reuse.
6447 There are undelete utilities that will attempt to reconstruct the index
6448 and can bring the file back if the parts were not reused.
6450 On a busy system with a nearly-full drive, space can get reused in a
6451 few seconds. But there is no way to know for sure. If you have
6452 sensitive data, you may want to be sure that recovery is not possible
6453 by actually overwriting the file with non-sensitive data.
6455 However, even after doing that, it is possible to take the disk back
6456 to a laboratory and use a lot of sensitive (and expensive) equipment to
6457 look for the faint "echoes" of the original data underneath the
6458 overwritten data. If the data has only been overwritten once, it's not
6461 The best way to remove something irretrievably is to destroy the
6462 media it's on with acid, melt it down, or the like. For cheap
6463 removable media like floppy disks, this is the preferred method.
6464 However, hard drives are expensive and hard to melt, so the `shred'
6465 utility tries to achieve a similar effect non-destructively.
6467 This uses many overwrite passes, with the data patterns chosen to
6468 maximize the damage they do to the old data. While this will work on
6469 floppies, the patterns are designed for best effect on hard drives.
6470 For more details, see the source code and Peter Gutmann's paper `Secure
6471 Deletion of Data from Magnetic and Solid-State Memory'
6472 (http://www.cs.auckland.ac.nz/~pgut001/pubs/secure_del.html), from the
6473 proceedings of the Sixth USENIX Security Symposium (San Jose,
6474 California, July 22-25, 1996).
6476 *Please note* that `shred' relies on a very important assumption:
6477 that the file system overwrites data in place. This is the traditional
6478 way to do things, but many modern file system designs do not satisfy
6479 this assumption. Exceptions include:
6481 * Log-structured or journaled file systems, such as those supplied
6482 with AIX and Solaris, and JFS, ReiserFS, XFS, Ext3 (in
6483 `data=journal' mode), BFS, NTFS, etc. when they are configured to
6486 * File systems that write redundant data and carry on even if some
6487 writes fail, such as RAID-based file systems.
6489 * File systems that make snapshots, such as Network Appliance's NFS
6492 * File systems that cache in temporary locations, such as NFS
6495 * Compressed file systems.
6497 In the particular case of ext3 file systems, the above disclaimer
6498 applies (and `shred' is thus of limited effectiveness) only in
6499 `data=journal' mode, which journals file data in addition to just
6500 metadata. In both the `data=ordered' (default) and `data=writeback'
6501 modes, `shred' works as usual. Ext3 journaling modes can be changed by
6502 adding the `data=something' option to the mount options for a
6503 particular file system in the `/etc/fstab' file, as documented in the
6504 mount man page (man mount).
6506 If you are not sure how your file system operates, then you should
6507 assume that it does not overwrite data in place, which means that shred
6508 cannot reliably operate on regular files in your file system.
6510 Generally speaking, it is more reliable to shred a device than a
6511 file, since this bypasses the problem of file system design mentioned
6512 above. However, even shredding devices is not always completely
6513 reliable. For example, most disks map out bad sectors invisibly to the
6514 application; if the bad sectors contain sensitive data, `shred' won't
6515 be able to destroy it.
6517 `shred' makes no attempt to detect or report this problem, just as
6518 it makes no attempt to do anything about backups. However, since it is
6519 more reliable to shred devices than files, `shred' by default does not
6520 truncate or remove the output file. This default is more suitable for
6521 devices, which typically cannot be truncated and should not be removed.
6523 Finally, consider the risk of backups and mirrors. File system
6524 backups and remote mirrors may contain copies of the file that cannot
6525 be removed, and that will allow a shredded file to be recovered later.
6526 So if you keep any data you may later want to destroy using `shred', be
6527 sure that it is not backed up or mirrored.
6529 shred [OPTION]... FILE[...]
6531 The program accepts the following options. Also see *Note Common
6536 Override file permissions if necessary to allow overwriting.
6540 `--iterations=NUMBER'
6541 By default, `shred' uses 25 passes of overwrite. This is enough
6542 for all of the useful overwrite patterns to be used at least once.
6543 You can reduce this to save time, or increase it if you have a lot
6546 `--random-source=FILE'
6547 Use FILE as a source of random data used to overwrite and to
6548 choose pass ordering. *Note Random sources::.
6552 Shred the first BYTES bytes of the file. The default is to shred
6553 the whole file. BYTES can be followed by a size specification like
6554 `K', `M', or `G' to specify a multiple. *Note Block size::.
6558 After shredding a file, truncate it (if possible) and then remove
6559 it. If a file has multiple links, only the named links will be
6564 Display status updates as sterilization proceeds.
6568 By default, `shred' rounds the size of a regular file up to the
6569 next multiple of the file system block size to fully erase the
6570 last block of the file. Use `--exact' to suppress that behavior.
6571 Thus, by default if you shred a 10-byte regular file on a system
6572 with 512-byte blocks, the resulting file will be 512 bytes long.
6573 With this option, shred does not increase the apparent size of the
6578 Normally, the last pass that `shred' writes is made up of random
6579 data. If this would be conspicuous on your hard drive (for
6580 example, because it looks like encrypted data), or you just think
6581 it's tidier, the `--zero' option adds an additional overwrite pass
6582 with all zero bits. This is in addition to the number of passes
6583 specified by the `--iterations' option.
6586 You might use the following command to erase all trace of the file
6587 system you'd created on the floppy disk in your first drive. That
6588 command takes about 20 minutes to erase a "1.44MB" (actually 1440 KiB)
6591 shred --verbose /dev/fd0
6593 Similarly, to erase all data on a selected partition of your hard
6594 disk, you could give a command like this:
6596 shred --verbose /dev/sda5
6598 A FILE of `-' denotes standard output. The intended use of this is
6599 to shred a removed temporary file. For example:
6601 i=`tempfile -m 0600`
6604 echo "Hello, world" >&3
6608 However, the command `shred - >file' does not shred the contents of
6609 FILE, since the shell truncates FILE before invoking `shred'. Use the
6610 command `shred file' or (if using a Bourne-compatible shell) the
6611 command `shred - 1<>file' instead.
6613 An exit status of zero indicates success, and a nonzero value
6617 File: coreutils.info, Node: Special file types, Next: Changing file attributes, Prev: Basic operations, Up: Top
6619 12 Special file types
6620 *********************
6622 This chapter describes commands which create special types of files (and
6623 `rmdir', which removes directories, one special file type).
6625 Although Unix-like operating systems have markedly fewer special file
6626 types than others, not _everything_ can be treated only as the
6627 undifferentiated byte stream of "normal files". For example, when a
6628 file is created or removed, the system must record this information,
6629 which it does in a "directory"--a special type of file. Although you
6630 can read directories as normal files, if you're curious, in order for
6631 the system to do its job it must impose a structure, a certain order,
6632 on the bytes of the file. Thus it is a "special" type of file.
6634 Besides directories, other special file types include named pipes
6635 (FIFOs), symbolic links, sockets, and so-called "special files".
6639 * link invocation:: Make a hard link via the link syscall
6640 * ln invocation:: Make links between files.
6641 * mkdir invocation:: Make directories.
6642 * mkfifo invocation:: Make FIFOs (named pipes).
6643 * mknod invocation:: Make block or character special files.
6644 * readlink invocation:: Print the referent of a symbolic link.
6645 * rmdir invocation:: Remove empty directories.
6646 * unlink invocation:: Remove files via the unlink syscall
6649 File: coreutils.info, Node: link invocation, Next: ln invocation, Up: Special file types
6651 12.1 `link': Make a hard link via the link syscall
6652 ==================================================
6654 `link' creates a single hard link at a time. It is a minimalist
6655 interface to the system-provided `link' function. *Note Hard Links:
6656 (libc)Hard Links. It avoids the bells and whistles of the more
6657 commonly-used `ln' command (*note ln invocation::). Synopsis:
6659 link FILENAME LINKNAME
6661 FILENAME must specify an existing file, and LINKNAME must specify a
6662 nonexistent entry in an existing directory. `link' simply calls `link
6663 (FILENAME, LINKNAME)' to create the link.
6665 On a GNU system, this command acts like `ln --directory
6666 --no-target-directory FILENAME LINKNAME'. However, the `--directory'
6667 and `--no-target-directory' options are not specified by POSIX, and the
6668 `link' command is more portable in practice.
6670 An exit status of zero indicates success, and a nonzero value
6674 File: coreutils.info, Node: ln invocation, Next: mkdir invocation, Prev: link invocation, Up: Special file types
6676 12.2 `ln': Make links between files
6677 ===================================
6679 `ln' makes links between files. By default, it makes hard links; with
6680 the `-s' option, it makes symbolic (or "soft") links. Synopses:
6682 ln [OPTION]... [-T] TARGET LINKNAME
6683 ln [OPTION]... TARGET
6684 ln [OPTION]... TARGET... DIRECTORY
6685 ln [OPTION]... -t DIRECTORY TARGET...
6687 * If two file names are given, `ln' creates a link to the first file
6690 * If one TARGET is given, `ln' creates a link to that file in the
6693 * If the `--target-directory' (`-t') option is given, or failing
6694 that if the last file is a directory and the
6695 `--no-target-directory' (`-T') option is not given, `ln' creates a
6696 link to each TARGET file in the specified directory, using the
6700 Normally `ln' does not remove existing files. Use the `--force'
6701 (`-f') option to remove them unconditionally, the `--interactive'
6702 (`-i') option to remove them conditionally, and the `--backup' (`-b')
6703 option to rename them.
6705 A "hard link" is another name for an existing file; the link and the
6706 original are indistinguishable. Technically speaking, they share the
6707 same inode, and the inode contains all the information about a
6708 file--indeed, it is not incorrect to say that the inode _is_ the file.
6709 On all existing implementations, you cannot make a hard link to a
6710 directory, and hard links cannot cross file system boundaries. (These
6711 restrictions are not mandated by POSIX, however.)
6713 "Symbolic links" ("symlinks" for short), on the other hand, are a
6714 special file type (which not all kernels support: System V release 3
6715 (and older) systems lack symlinks) in which the link file actually
6716 refers to a different file, by name. When most operations (opening,
6717 reading, writing, and so on) are passed the symbolic link file, the
6718 kernel automatically "dereferences" the link and operates on the target
6719 of the link. But some operations (e.g., removing) work on the link
6720 file itself, rather than on its target. *Note Symbolic Links:
6721 (libc)Symbolic Links.
6723 The program accepts the following options. Also see *Note Common
6728 *Note Backup options::. Make a backup of each file that would
6729 otherwise be overwritten or removed.
6734 Allow users with appropriate privileges to attempt to make hard
6735 links to directories. However, note that this will probably fail
6736 due to system restrictions, even for the super-user.
6740 Remove existing destination files.
6744 Prompt whether to remove existing destination files.
6748 Do not treat the last operand specially when it is a symbolic link
6749 to a directory. Instead, treat it as if it were a normal file.
6751 When the destination is an actual directory (not a symlink to one),
6752 there is no ambiguity. The link is created in that directory.
6753 But when the specified destination is a symlink to a directory,
6754 there are two ways to treat the user's request. `ln' can treat
6755 the destination just as it would a normal directory and create the
6756 link in it. On the other hand, the destination can be viewed as a
6757 non-directory--as the symlink itself. In that case, `ln' must
6758 delete or backup that symlink before creating the new link. The
6759 default is to treat a destination that is a symlink to a directory
6760 just like a directory.
6762 This option is weaker than the `--no-target-directory' (`-T')
6763 option, so it has no effect if both options are given.
6767 Make symbolic links instead of hard links. This option merely
6768 produces an error message on systems that do not support symbolic
6773 Append SUFFIX to each backup file made with `-b'. *Note Backup
6777 `--target-directory=DIRECTORY'
6778 Specify the destination DIRECTORY. *Note Target directory::.
6781 `--no-target-directory'
6782 Do not treat the last operand specially when it is a directory or a
6783 symbolic link to a directory. *Note Target directory::.
6787 Print the name of each file after linking it successfully.
6790 An exit status of zero indicates success, and a nonzero value
6797 # Create link ../a pointing to a in that directory.
6798 # Not really useful because it points to itself.
6803 # Change to the target before creating symlinks to avoid being confused.
6809 # Hard coded file names don't move well.
6810 ln -s $(pwd)/a /some/dir/
6814 # Relative file names survive directory moves and also
6815 # work across networked file systems.
6816 ln -s afile anotherfile
6817 ln -s ../adir/afile yetanotherfile
6820 File: coreutils.info, Node: mkdir invocation, Next: mkfifo invocation, Prev: ln invocation, Up: Special file types
6822 12.3 `mkdir': Make directories
6823 ==============================
6825 `mkdir' creates directories with the specified names. Synopsis:
6827 mkdir [OPTION]... NAME...
6829 `mkdir' creates each directory NAME in the order given. It reports
6830 an error if NAME already exists, unless the `-p' option is given and
6831 NAME is a directory.
6833 The program accepts the following options. Also see *Note Common
6838 Set the file permission bits of created directories to MODE, which
6839 uses the same syntax as in `chmod' and uses `a=rwx' (read, write
6840 and execute allowed for everyone) for the point of the departure.
6841 *Note File permissions::.
6843 Normally the directory has the desired file mode bits at the
6844 moment it is created. As a GNU extension, MODE may also mention
6845 special mode bits, but in this case there may be a temporary window
6846 during which the directory exists but its special mode bits are
6847 incorrect. *Note Directory Setuid and Setgid::, for how the
6848 set-user-ID and set-group-ID bits of directories are inherited
6849 unless overridden in this way.
6853 Make any missing parent directories for each argument, setting
6854 their file permission bits to the umask modified by `u+wx'. Ignore
6855 existing parent directories, and do not change their file
6858 To set the file permission bits of any newly-created parent
6859 directories to a value that includes `u+wx', you can set the umask
6860 before invoking `mkdir'. For example, if the shell command
6861 `(umask u=rwx,go=rx; mkdir -p P/Q)' creates the parent `P' it sets
6862 the parent's permission bits to `u=rwx,go=rx'. To set a parent's
6863 special mode bits as well, you can invoke `chmod' after `mkdir'.
6864 *Note Directory Setuid and Setgid::, for how the set-user-ID and
6865 set-group-ID bits of newly-created parent directories are
6870 Print a message for each created directory. This is most useful
6873 An exit status of zero indicates success, and a nonzero value
6877 File: coreutils.info, Node: mkfifo invocation, Next: mknod invocation, Prev: mkdir invocation, Up: Special file types
6879 12.4 `mkfifo': Make FIFOs (named pipes)
6880 =======================================
6882 `mkfifo' creates FIFOs (also called "named pipes") with the specified
6885 mkfifo [OPTION] NAME...
6887 A "FIFO" is a special file type that permits independent processes
6888 to communicate. One process opens the FIFO file for writing, and
6889 another for reading, after which data can flow as with the usual
6890 anonymous pipe in shells or elsewhere.
6892 The program accepts the following option. Also see *Note Common
6897 Set the mode of created FIFOs to MODE, which is symbolic as in
6898 `chmod' and uses `a=rw' (read and write allowed for everyone) for
6899 the point of departure. MODE should specify only file permission
6900 bits. *Note File permissions::.
6903 An exit status of zero indicates success, and a nonzero value
6907 File: coreutils.info, Node: mknod invocation, Next: readlink invocation, Prev: mkfifo invocation, Up: Special file types
6909 12.5 `mknod': Make block or character special files
6910 ===================================================
6912 `mknod' creates a FIFO, character special file, or block special file
6913 with the specified name. Synopsis:
6915 mknod [OPTION]... NAME TYPE [MAJOR MINOR]
6917 Unlike the phrase "special file type" above, the term "special file"
6918 has a technical meaning on Unix: something that can generate or receive
6919 data. Usually this corresponds to a physical piece of hardware, e.g.,
6920 a printer or a disk. (These files are typically created at
6921 system-configuration time.) The `mknod' command is what creates files
6922 of this type. Such devices can be read either a character at a time or
6923 a "block" (many characters) at a time, hence we say there are "block
6924 special" files and "character special" files.
6926 The arguments after NAME specify the type of file to make:
6932 for a block special file
6935 for a character special file
6938 When making a block or character special file, the major and minor
6939 device numbers must be given after the file type. If a major or minor
6940 device number begins with `0x' or `0X', it is interpreted as
6941 hexadecimal; otherwise, if it begins with `0', as octal; otherwise, as
6944 The program accepts the following option. Also see *Note Common
6949 Set the mode of created files to MODE, which is symbolic as in
6950 `chmod' and uses `a=rw' as the point of departure. MODE should
6951 specify only file permission bits. *Note File permissions::.
6954 An exit status of zero indicates success, and a nonzero value
6958 File: coreutils.info, Node: readlink invocation, Next: rmdir invocation, Prev: mknod invocation, Up: Special file types
6960 12.6 `readlink': Print the referent of a symbolic link
6961 ======================================================
6963 `readlink' may work in one of two supported modes:
6966 `readlink' outputs the value of the given symbolic link. If
6967 `readlink' is invoked with an argument other than the name of a
6968 symbolic link, it produces no output and exits with a nonzero exit
6972 `readlink' outputs the absolute name of the given file which
6973 contains no `.', `..' components nor any repeated separators (`/')
6977 readlink [OPTION] FILE
6979 By default, `readlink' operates in readlink mode.
6981 The program accepts the following options. Also see *Note Common
6986 Activate canonicalize mode. If any component of the file name
6987 except the last one is missing or unavailable, `readlink' produces
6988 no output and exits with a nonzero exit code.
6991 `--canonicalize-existing'
6992 Activate canonicalize mode. If any component is missing or
6993 unavailable, `readlink' produces no output and exits with a
6997 `--canonicalize-missing'
6998 Activate canonicalize mode. If any component is missing or
6999 unavailable, `readlink' treats it as a directory.
7003 Do not output the trailing newline.
7009 Suppress most error messages.
7013 Report error messages.
7016 The `readlink' utility first appeared in OpenBSD 2.1.
7018 An exit status of zero indicates success, and a nonzero value
7022 File: coreutils.info, Node: rmdir invocation, Next: unlink invocation, Prev: readlink invocation, Up: Special file types
7024 12.7 `rmdir': Remove empty directories
7025 ======================================
7027 `rmdir' removes empty directories. Synopsis:
7029 rmdir [OPTION]... DIRECTORY...
7031 If any DIRECTORY argument does not refer to an existing empty
7032 directory, it is an error.
7034 The program accepts the following option. Also see *Note Common
7037 `--ignore-fail-on-non-empty'
7038 Ignore each failure to remove a directory that is solely because
7039 the directory is non-empty.
7043 Remove DIRECTORY, then try to remove each component of DIRECTORY.
7044 So, for example, `rmdir -p a/b/c' is similar to `rmdir a/b/c a/b
7045 a'. As such, it fails if any of those directories turns out not
7046 to be empty. Use the `--ignore-fail-on-non-empty' option to make
7047 it so such a failure does not evoke a diagnostic and does not
7048 cause `rmdir' to exit unsuccessfully.
7052 Give a diagnostic for each successful removal. DIRECTORY is
7056 *Note rm invocation::, for how to remove non-empty directories
7059 An exit status of zero indicates success, and a nonzero value
7063 File: coreutils.info, Node: unlink invocation, Prev: rmdir invocation, Up: Special file types
7065 12.8 `unlink': Remove files via the unlink syscall
7066 ==================================================
7068 `unlink' deletes a single specified file name. It is a minimalist
7069 interface to the system-provided `unlink' function. *Note Deleting
7070 Files: (libc)Deleting Files. Synopsis: It avoids the bells and
7071 whistles of the more commonly-used `rm' command (*note rm invocation::).
7075 On some systems `unlink' can be used to delete the name of a
7076 directory. On others, it can be used that way only by a privileged
7077 user. In the GNU system `unlink' can never delete the name of a
7080 The `unlink' command honors the `--help' and `--version' options.
7081 To remove a file whose name begins with `-', prefix the name with `./',
7082 e.g., `unlink ./--help'.
7084 An exit status of zero indicates success, and a nonzero value
7088 File: coreutils.info, Node: Changing file attributes, Next: Disk usage, Prev: Special file types, Up: Top
7090 13 Changing file attributes
7091 ***************************
7093 A file is not merely its contents, a name, and a file type (*note
7094 Special file types::). A file also has an owner (a user ID), a group
7095 (a group ID), permissions (what the owner can do with the file, what
7096 people in the group can do, and what everyone else can do), various
7097 timestamps, and other information. Collectively, we call these a file's
7100 These commands change file attributes.
7104 * chgrp invocation:: Change file groups.
7105 * chmod invocation:: Change access permissions.
7106 * chown invocation:: Change file owners and groups.
7107 * touch invocation:: Change file timestamps.
7110 File: coreutils.info, Node: chown invocation, Next: touch invocation, Prev: chmod invocation, Up: Changing file attributes
7112 13.1 `chown': Change file owner and group
7113 =========================================
7115 `chown' changes the user and/or group ownership of each given FILE to
7116 NEW-OWNER or to the user and group of an existing reference file.
7119 chown [OPTION]... {NEW-OWNER | --reference=REF_FILE} FILE...
7121 If used, NEW-OWNER specifies the new owner and/or group as follows
7122 (with no embedded white space):
7124 [OWNER] [ : [GROUP] ]
7129 If only an OWNER (a user name or numeric user ID) is given, that
7130 user is made the owner of each given file, and the files' group is
7134 If the OWNER is followed by a colon and a GROUP (a group name or
7135 numeric group ID), with no spaces between them, the group
7136 ownership of the files is changed as well (to GROUP).
7139 If a colon but no group name follows OWNER, that user is made the
7140 owner of the files and the group of the files is changed to
7141 OWNER's login group.
7144 If the colon and following GROUP are given, but the owner is
7145 omitted, only the group of the files is changed; in this case,
7146 `chown' performs the same function as `chgrp'.
7149 If only a colon is given, or if NEW-OWNER is empty, neither the
7150 owner nor the group is changed.
7153 If OWNER or GROUP is intended to represent a numeric user or group
7154 ID, then you may specify it with a leading `+'. *Note Disambiguating
7157 Some older scripts may still use `.' in place of the `:' separator.
7158 POSIX 1003.1-2001 (*note Standards conformance::) does not require
7159 support for that, but for backward compatibility GNU `chown' supports
7160 `.' so long as no ambiguity results. New scripts should avoid the use
7161 of `.' because it is not portable, and because it has undesirable
7162 results if the entire OWNER`.'GROUP happens to identify a user whose
7165 The `chown' command sometimes clears the set-user-ID or set-group-ID
7166 permission bits. This behavior depends on the policy and functionality
7167 of the underlying `chown' system call, which may make system-dependent
7168 file mode modifications outside the control of the `chown' command.
7169 For example, the `chown' command might not affect those bits when
7170 invoked by a user with appropriate privileges, or when the bits signify
7171 some function other than executable permission (e.g., mandatory
7172 locking). When in doubt, check the underlying system behavior.
7174 The program accepts the following options. Also see *Note Common
7179 Verbosely describe the action for each FILE whose ownership
7185 Do not print error messages about files whose ownership cannot be
7189 Change a FILE's ownership only if it has current attributes
7190 specified by OLD-OWNER. OLD-OWNER has the same form as NEW-OWNER
7191 described above. This option is useful primarily from a security
7192 standpoint in that it narrows considerably the window of potential
7193 abuse. For example, to reflect a user ID numbering change for one
7194 user's files without an option like this, `root' might run
7196 find / -owner OLDUSER -print0 | xargs -0 chown -h NEWUSER
7198 But that is dangerous because the interval between when the `find'
7199 tests the existing file's owner and when the `chown' is actually
7200 run may be quite large. One way to narrow the gap would be to
7201 invoke chown for each file as it is found:
7203 find / -owner OLDUSER -exec chown -h NEWUSER {} \;
7205 But that is very slow if there are many affected files. With this
7206 option, it is safer (the gap is narrower still) though still not
7209 chown -h -R --from=OLDUSER NEWUSER /
7212 Do not act on symbolic links themselves but rather on what they
7213 point to. This is the default.
7217 Act on symbolic links themselves instead of what they point to.
7218 This mode relies on the `lchown' system call. On systems that do
7219 not provide the `lchown' system call, `chown' fails when a file
7220 specified on the command line is a symbolic link. By default, no
7221 diagnostic is issued for symbolic links encountered during a
7222 recursive traversal, but see `--verbose'.
7225 Fail upon any attempt to recursively change the root directory,
7226 `/'. Without `--recursive', this option has no effect. *Note
7227 Treating / specially::.
7229 `--no-preserve-root'
7230 Cancel the effect of any preceding `--preserve-root' option.
7231 *Note Treating / specially::.
7233 `--reference=REF_FILE'
7234 Change the user and group of each FILE to be the same as those of
7235 REF_FILE. If REF_FILE is a symbolic link, do not use the user and
7236 group of the symbolic link, but rather those of the file it refers
7241 Output a diagnostic for every file processed. If a symbolic link
7242 is encountered during a recursive traversal on a system without
7243 the `lchown' system call, and `--no-dereference' is in effect,
7244 then issue a diagnostic saying neither the symbolic link nor its
7245 referent is being changed.
7249 Recursively change ownership of directories and their contents.
7252 If `--recursive' (`-R') is specified and a command line argument
7253 is a symbolic link to a directory, traverse it. *Note Traversing
7257 In a recursive traversal, traverse every symbolic link to a
7258 directory that is encountered. *Note Traversing symlinks::.
7261 Do not traverse any symbolic links. This is the default if none
7262 of `-H', `-L', or `-P' is specified. *Note Traversing symlinks::.
7265 An exit status of zero indicates success, and a nonzero value
7270 # Change the owner of /u to "root".
7273 # Likewise, but also change its group to "staff".
7276 # Change the owner of /u and subfiles to "root".
7280 File: coreutils.info, Node: chgrp invocation, Next: chmod invocation, Up: Changing file attributes
7282 13.2 `chgrp': Change group ownership
7283 ====================================
7285 `chgrp' changes the group ownership of each given FILE to GROUP (which
7286 can be either a group name or a numeric group ID) or to the group of an
7287 existing reference file. Synopsis:
7289 chgrp [OPTION]... {GROUP | --reference=REF_FILE} FILE...
7291 If GROUP is intended to represent a numeric group ID, then you may
7292 specify it with a leading `+'. *Note Disambiguating names and IDs::.
7294 The program accepts the following options. Also see *Note Common
7299 Verbosely describe the action for each FILE whose group actually
7305 Do not print error messages about files whose group cannot be
7309 Do not act on symbolic links themselves but rather on what they
7310 point to. This is the default.
7314 Act on symbolic links themselves instead of what they point to.
7315 This mode relies on the `lchown' system call. On systems that do
7316 not provide the `lchown' system call, `chgrp' fails when a file
7317 specified on the command line is a symbolic link. By default, no
7318 diagnostic is issued for symbolic links encountered during a
7319 recursive traversal, but see `--verbose'.
7322 Fail upon any attempt to recursively change the root directory,
7323 `/'. Without `--recursive', this option has no effect. *Note
7324 Treating / specially::.
7326 `--no-preserve-root'
7327 Cancel the effect of any preceding `--preserve-root' option.
7328 *Note Treating / specially::.
7330 `--reference=REF_FILE'
7331 Change the group of each FILE to be the same as that of REF_FILE.
7332 If REF_FILE is a symbolic link, do not use the group of the
7333 symbolic link, but rather that of the file it refers to.
7337 Output a diagnostic for every file processed. If a symbolic link
7338 is encountered during a recursive traversal on a system without
7339 the `lchown' system call, and `--no-dereference' is in effect,
7340 then issue a diagnostic saying neither the symbolic link nor its
7341 referent is being changed.
7345 Recursively change the group ownership of directories and their
7349 If `--recursive' (`-R') is specified and a command line argument
7350 is a symbolic link to a directory, traverse it. *Note Traversing
7354 In a recursive traversal, traverse every symbolic link to a
7355 directory that is encountered. *Note Traversing symlinks::.
7358 Do not traverse any symbolic links. This is the default if none
7359 of `-H', `-L', or `-P' is specified. *Note Traversing symlinks::.
7362 An exit status of zero indicates success, and a nonzero value
7367 # Change the group of /u to "staff".
7370 # Change the group of /u and subfiles to "staff".
7374 File: coreutils.info, Node: chmod invocation, Next: chown invocation, Prev: chgrp invocation, Up: Changing file attributes
7376 13.3 `chmod': Change access permissions
7377 =======================================
7379 `chmod' changes the access permissions of the named files. Synopsis:
7381 chmod [OPTION]... {MODE | --reference=REF_FILE} FILE...
7383 `chmod' never changes the permissions of symbolic links, since the
7384 `chmod' system call cannot change their permissions. This is not a
7385 problem since the permissions of symbolic links are never used.
7386 However, for each symbolic link listed on the command line, `chmod'
7387 changes the permissions of the pointed-to file. In contrast, `chmod'
7388 ignores symbolic links encountered during recursive directory
7391 A successful use of `chmod' clears the set-group-ID bit of a regular
7392 file if the file's group ID does not match the user's effective group
7393 ID or one of the user's supplementary group IDs, unless the user has
7394 appropriate privileges. Additional restrictions may cause the
7395 set-user-ID and set-group-ID bits of MODE or REF_FILE to be ignored.
7396 This behavior depends on the policy and functionality of the underlying
7397 `chmod' system call. When in doubt, check the underlying system
7400 If used, MODE specifies the new file mode bits. For details, see
7401 the section on *Note File permissions::. If you really want MODE to
7402 have a leading `-', you should use `--' first, e.g., `chmod -- -w
7403 file'. Typically, though, `chmod a-w file' is preferable, and `chmod -w
7404 file' (without the `--') complains if it behaves differently from what
7405 `chmod a-w file' would do.
7407 The program accepts the following options. Also see *Note Common
7412 Verbosely describe the action for each FILE whose permissions
7418 Do not print error messages about files whose permissions cannot be
7422 Fail upon any attempt to recursively change the root directory,
7423 `/'. Without `--recursive', this option has no effect. *Note
7424 Treating / specially::.
7426 `--no-preserve-root'
7427 Cancel the effect of any preceding `--preserve-root' option.
7428 *Note Treating / specially::.
7432 Verbosely describe the action or non-action taken for every FILE.
7434 `--reference=REF_FILE'
7435 Change the mode of each FILE to be the same as that of REF_FILE.
7436 *Note File permissions::. If REF_FILE is a symbolic link, do not
7437 use the mode of the symbolic link, but rather that of the file it
7442 Recursively change permissions of directories and their contents.
7445 An exit status of zero indicates success, and a nonzero value
7449 File: coreutils.info, Node: touch invocation, Prev: chown invocation, Up: Changing file attributes
7451 13.4 `touch': Change file timestamps
7452 ====================================
7454 `touch' changes the access and/or modification times of the specified
7457 touch [OPTION]... FILE...
7459 Any FILE that does not exist is created empty.
7461 A FILE of `-' causes `touch' to change the times of the file
7462 associated with standard output.
7464 If changing both the access and modification times to the current
7465 time, `touch' can change the timestamps for files that the user running
7466 it does not own but has write permission for. Otherwise, the user must
7469 Although `touch' provides options for changing two of the times--the
7470 times of last access and modification--of a file, there is actually a
7471 third one as well: the inode change time. This is often referred to as
7472 a file's `ctime'. The inode change time represents the time when the
7473 file's meta-information last changed. One common example of this is
7474 when the permissions of a file change. Changing the permissions
7475 doesn't access the file, so the atime doesn't change, nor does it
7476 modify the file, so the mtime doesn't change. Yet, something about the
7477 file itself has changed, and this must be noted somewhere. This is the
7478 job of the ctime field. This is necessary, so that, for example, a
7479 backup program can make a fresh copy of the file, including the new
7480 permissions value. Another operation that modifies a file's ctime
7481 without affecting the others is renaming. In any case, it is not
7482 possible, in normal operations, for a user to change the ctime field to
7483 a user-specified value.
7485 Time stamps assume the time zone rules specified by the `TZ'
7486 environment variable, or by the system default rules if `TZ' is not
7487 set. *Note Specifying the Time Zone with `TZ': (libc)TZ Variable. You
7488 can avoid ambiguities during daylight saving transitions by using UTC
7491 The program accepts the following options. Also see *Note Common
7498 Change the access time only.
7502 Do not create files that do not exist.
7506 Use TIME instead of the current time. It can contain month names,
7507 time zones, `am' and `pm', `yesterday', etc. For example,
7508 `--date="2004-02-27 14:19:13.489392193 +0530"' specifies the
7509 instant of time that is 489,392,193 nanoseconds after February 27,
7510 2004 at 2:19:13 PM in a time zone that is 5 hours and 30 minutes
7511 east of UTC. *Note Date input formats::. File systems that do
7512 not support high-resolution time stamps silently ignore any excess
7516 Ignored; for compatibility with BSD versions of `touch'.
7521 Change the modification time only.
7525 Use the times of the reference FILE instead of the current time.
7526 If this option is combined with the `--date=TIME' (`-d TIME')
7527 option, the reference FILE's time is the origin for any relative
7528 TIMEs given, but is otherwise ignored. For example, `-r foo -d
7529 '-5 seconds'' specifies a time stamp equal to five seconds before
7530 the corresponding time stamp for `foo'.
7532 `-t [[CC]YY]MMDDHHMM[.SS]'
7533 Use the argument (optional four-digit or two-digit years, months,
7534 days, hours, minutes, optional seconds) instead of the current
7535 time. If the year is specified with only two digits, then CC is
7536 20 for years in the range 0 ... 68, and 19 for years in 69 ... 99.
7537 If no digits of the year are specified, the argument is
7538 interpreted as a date in the current year.
7541 On older systems, `touch' supports an obsolete syntax, as follows.
7542 If no timestamp is given with any of the `-d', `-r', or `-t' options,
7543 and if there are two or more FILEs and the first FILE is of the form
7544 `MMDDHHMM[YY]' and this would be a valid argument to the `-t' option
7545 (if the YY, if any, were moved to the front), and if the represented
7546 year is in the range 1969-1999, that argument is interpreted as the time
7547 for the other files instead of as a file name. This obsolete behavior
7548 can be enabled or disabled with the `_POSIX2_VERSION' environment
7549 variable (*note Standards conformance::), but portable scripts should
7550 avoid commands whose behavior depends on this variable. For example,
7551 use `touch ./12312359 main.c' or `touch -t 12312359 main.c' rather than
7552 the ambiguous `touch 12312359 main.c'.
7554 An exit status of zero indicates success, and a nonzero value
7558 File: coreutils.info, Node: Disk usage, Next: Printing text, Prev: Changing file attributes, Up: Top
7563 No disk can hold an infinite amount of data. These commands report how
7564 much disk storage is in use or available, report other file and file
7565 status information, and write buffers to disk.
7569 * df invocation:: Report file system disk space usage.
7570 * du invocation:: Estimate file space usage.
7571 * stat invocation:: Report file or file system status.
7572 * sync invocation:: Synchronize memory and disk.
7575 File: coreutils.info, Node: df invocation, Next: du invocation, Up: Disk usage
7577 14.1 `df': Report file system disk space usage
7578 ==============================================
7580 `df' reports the amount of disk space used and available on file
7583 df [OPTION]... [FILE]...
7585 With no arguments, `df' reports the space used and available on all
7586 currently mounted file systems (of all types). Otherwise, `df' reports
7587 on the file system containing each argument FILE.
7589 Normally the disk space is printed in units of 1024 bytes, but this
7590 can be overridden (*note Block size::). Non-integer quantities are
7591 rounded up to the next higher unit.
7593 If an argument FILE is a disk device file containing a mounted file
7594 system, `df' shows the space available on that file system rather than
7595 on the file system containing the device node (i.e., the root file
7596 system). GNU `df' does not attempt to determine the disk usage on
7597 unmounted file systems, because on most kinds of systems doing so
7598 requires extremely nonportable intimate knowledge of file system
7601 The program accepts the following options. Also see *Note Common
7606 Include in the listing dummy file systems, which are omitted by
7607 default. Such file systems are typically special-purpose
7608 pseudo-file-systems, such as automounter entries.
7612 Scale sizes by SIZE before printing them (*note Block size::).
7613 For example, `-BG' prints sizes in units of 1,073,741,824 bytes.
7617 Append a size letter to each size, such as `M' for mebibytes.
7618 Powers of 1024 are used, not 1000; `M' stands for 1,048,576 bytes.
7619 Use the `--si' option if you prefer powers of 1000.
7622 Equivalent to `--si'.
7626 List inode usage information instead of block usage. An inode
7627 (short for index node) contains information about a file such as
7628 its owner, permissions, timestamps, and location on the disk.
7631 Print sizes in 1024-byte blocks, overriding the default block size
7632 (*note Block size::). This option is equivalent to
7637 Limit the listing to local file systems. By default, remote file
7638 systems are also listed.
7641 Do not invoke the `sync' system call before getting any usage data.
7642 This may make `df' run significantly faster on systems with many
7643 disks, but on some systems (notably SunOS) the results may be
7644 slightly out of date. This is the default.
7648 Use the POSIX output format. This is like the default format
7649 except for the following:
7651 1. The information about each file system is always printed on
7652 exactly one line; a mount device is never put on a line by
7653 itself. This means that if the mount device name is more
7654 than 20 characters long (e.g., for some network mounts), the
7655 columns are misaligned.
7657 2. The labels in the header output line are changed to conform
7660 3. The default block size and output format are unaffected by the
7661 `DF_BLOCK_SIZE', `BLOCK_SIZE' and `BLOCKSIZE' environment
7662 variables. However, the default block size is still affected
7663 by `POSIXLY_CORRECT': it is 512 if `POSIXLY_CORRECT' is set,
7664 1024 otherwise. *Note Block size::.
7667 Append an SI-style abbreviation to each size, such as `M' for
7668 megabytes. Powers of 1000 are used, not 1024; `M' stands for
7669 1,000,000 bytes. This option is equivalent to `--block-size=si'.
7670 Use the `-h' or `--human-readable' option if you prefer powers of
7674 Invoke the `sync' system call before getting any usage data. On
7675 some systems (notably SunOS), doing this yields more up to date
7676 results, but in general this option makes `df' much slower,
7677 especially when there are many or very busy file systems.
7681 Limit the listing to file systems of type FSTYPE. Multiple file
7682 system types can be specified by giving multiple `-t' options. By
7683 default, nothing is omitted.
7687 Print each file system's type. The types printed here are the
7688 same ones you can include or exclude with `-t' and `-x'. The
7689 particular types printed are whatever is supported by the system.
7690 Here are some of the common names (this list is certainly not
7694 An NFS file system, i.e., one mounted over a network from
7695 another machine. This is the one type name which seems to be
7696 used uniformly by all systems.
7699 A file system on a locally-mounted hard disk. (The system
7700 might even support more than one type here; Linux does.)
7703 A file system on a CD-ROM drive. HP-UX uses `cdfs', most
7704 other systems use `hsfs' (`hs' for "High Sierra").
7707 An MS-DOS file system, usually on a diskette.
7711 `--exclude-type=FSTYPE'
7712 Limit the listing to file systems not of type FSTYPE. Multiple
7713 file system types can be eliminated by giving multiple `-x'
7714 options. By default, no file system types are omitted.
7717 Ignored; for compatibility with System V versions of `df'.
7720 An exit status of zero indicates success, and a nonzero value
7721 indicates failure. Failure includes the case where no output is
7722 generated, so you can inspect the exit status of a command like `df -t
7723 ext3 -t reiserfs DIR' to test whether DIR is on a file system of type
7724 `ext3' or `reiserfs'.
7727 File: coreutils.info, Node: du invocation, Next: stat invocation, Prev: df invocation, Up: Disk usage
7729 14.2 `du': Estimate file space usage
7730 ====================================
7732 `du' reports the amount of disk space used by the specified files and
7733 for each subdirectory (of directory arguments). Synopsis:
7735 du [OPTION]... [FILE]...
7737 With no arguments, `du' reports the disk space for the current
7738 directory. Normally the disk space is printed in units of 1024 bytes,
7739 but this can be overridden (*note Block size::). Non-integer
7740 quantities are rounded up to the next higher unit.
7742 The program accepts the following options. Also see *Note Common
7747 Show counts for all files, not just directories.
7750 Print apparent sizes, rather than disk usage. The apparent size
7751 of a file is the number of bytes reported by `wc -c' on regular
7752 files, or more generally, `ls -l --block-size=1' or `stat
7753 --format=%s'. For example, a file containing the word `zoo' with
7754 no newline would, of course, have an apparent size of 3. Such a
7755 small file may require anywhere from 0 to 16 KiB or more of disk
7756 space, depending on the type and configuration of the file system
7757 on which the file resides. However, a sparse file created with
7760 dd bs=1 seek=2GiB if=/dev/null of=big
7762 has an apparent size of 2 GiB, yet on most modern systems, it
7763 actually uses almost no disk space.
7767 Equivalent to `--apparent-size --block-size=1'.
7771 Scale sizes by SIZE before printing them (*note Block size::).
7772 For example, `-BG' prints sizes in units of 1,073,741,824 bytes.
7776 Print a grand total of all arguments after all arguments have been
7777 processed. This can be used to find out the total disk usage of a
7778 given set of files or directories.
7781 `--dereference-args'
7782 Dereference symbolic links that are command line arguments. Does
7783 not affect other symbolic links. This is helpful for finding out
7784 the disk usage of directories, such as `/usr/tmp', which are often
7787 `--files0-from=FILE'
7788 Rather than processing files named on the command line, process
7789 those named in file FILE; each name is terminated by a null byte.
7790 This is useful with the `--total' (`-c') option when the list of
7791 file names is so long that it may exceed a command line length
7792 limitation. In such cases, running `du' via `xargs' is undesirable
7793 because it splits the list into pieces and makes `du' print a
7794 total for each sublist rather than for the entire list. One way
7795 to produce a list of null-byte-terminated file names is with GNU
7796 `find', using its `-print0' predicate. Do not specify any FILE on
7797 the command line when using this option.
7801 Append a size letter to each size, such as `M' for mebibytes.
7802 Powers of 1024 are used, not 1000; `M' stands for 1,048,576 bytes.
7803 Use the `--si' option if you prefer powers of 1000.
7806 Currently, `-H' is the same as `--si', except that `-H' evokes a
7807 warning. This option will be changed to be equivalent to
7808 `--dereference-args' (`-D').
7811 Print sizes in 1024-byte blocks, overriding the default block size
7812 (*note Block size::). This option is equivalent to
7817 Count the size of all files, even if they have appeared already
7822 Dereference symbolic links (show the disk space used by the file
7823 or directory that the link points to instead of the space used by
7827 Print sizes in 1,048,576-byte blocks, overriding the default block
7828 size (*note Block size::). This option is equivalent to
7833 For each symbolic links encountered by `du', consider the disk
7834 space used by the symbolic link.
7837 Show the total for each directory (and file if -all) that is at
7838 most MAX_DEPTH levels down from the root of the hierarchy. The
7839 root is at level 0, so `du --max-depth=0' is equivalent to `du -s'.
7843 Output a null byte at the end of each line, rather than a newline.
7844 This option enables other programs to parse the output of `du'
7845 even when that output would contain file names with embedded
7849 Append an SI-style abbreviation to each size, such as `MB' for
7850 megabytes. Powers of 1000 are used, not 1024; `MB' stands for
7851 1,000,000 bytes. Use the `-h' or `--human-readable' option if you
7852 prefer powers of 1024.
7856 Display only a total for each argument.
7860 Report the size of each directory separately, not including the
7861 sizes of subdirectories.
7864 Show time of the most recent modification of any file in the
7865 directory, or any of its subdirectories.
7870 Show the most recent status change time (the `ctime' in the inode)
7871 of any file in the directory, instead of the modification time.
7875 Show the most recent access time (the `atime' in the inode) of any
7876 file in the directory, instead of the modification time.
7878 `--time-style=STYLE'
7879 List timestamps in style STYLE. This option has an effect only if
7880 the `--time' option is also specified. The STYLE should be one of
7884 List timestamps using FORMAT, where FORMAT is interpreted
7885 like the format argument of `date' (*note date invocation::).
7886 For example, `--time-style="+%Y-%m-%d %H:%M:%S"' causes `du'
7887 to list timestamps like `2002-03-30 23:45:56'. As with
7888 `date', FORMAT's interpretation is affected by the `LC_TIME'
7892 List timestamps in full using ISO 8601 date, time, and time
7893 zone format with nanosecond precision, e.g., `2002-03-30
7894 23:45:56.477817180 -0700'. This style is equivalent to
7895 `+%Y-%m-%d %H:%M:%S.%N %z'.
7898 List ISO 8601 date and time in minutes, e.g., `2002-03-30
7899 23:45'. These timestamps are shorter than `full-iso'
7900 timestamps, and are usually good enough for everyday work.
7901 This style is equivalent to `+%Y-%m-%d %H:%M'.
7904 List ISO 8601 dates for timestamps, e.g., `2002-03-30'. This
7905 style is equivalent to `+%Y-%m-%d'.
7907 You can specify the default value of the `--time-style' option
7908 with the environment variable `TIME_STYLE'; if `TIME_STYLE' is not
7909 set the default style is `long-iso'. For compatibility with `ls',
7910 if `TIME_STYLE' begins with `+' and contains a newline, the
7911 newline and any later characters are ignored; if `TIME_STYLE'
7912 begins with `posix-' the `posix-' is ignored; and if `TIME_STYLE'
7913 is `locale' it is ignored.
7917 Skip directories that are on different file systems from the one
7918 that the argument being processed is on.
7921 When recursing, skip subdirectories or files matching PATTERN.
7922 For example, `du --exclude='*.o'' excludes files whose names end
7926 `--exclude-from=FILE'
7927 Like `--exclude', except take the patterns to exclude from FILE,
7928 one per line. If FILE is `-', take the patterns from standard
7932 On BSD systems, `du' reports sizes that are half the correct values
7933 for files that are NFS-mounted from HP-UX systems. On HP-UX systems,
7934 it reports sizes that are twice the correct values for files that are
7935 NFS-mounted from BSD systems. This is due to a flaw in HP-UX; it also
7936 affects the HP-UX `du' program.
7938 An exit status of zero indicates success, and a nonzero value
7942 File: coreutils.info, Node: stat invocation, Next: sync invocation, Prev: du invocation, Up: Disk usage
7944 14.3 `stat': Report file or file system status
7945 ==============================================
7947 `stat' displays information about the specified file(s). Synopsis:
7949 stat [OPTION]... [FILE]...
7951 With no option, `stat' reports all information about the given files.
7952 But it also can be used to report the information of the file systems
7953 the given files are located on. If the files are links, `stat' can
7954 also give information about the files the links point to.
7958 Change how `stat' treats symbolic links. With this option, `stat'
7959 acts on the file referenced by each symbolic link argument.
7960 Without it, `stat' acts on any symbolic link argument directly.
7964 Report information about the file systems where the given files
7965 are located instead of information about the files themselves.
7969 Use FORMAT rather than the default format. FORMAT is
7970 automatically newline-terminated, so running a command like the
7971 following with two or more FILE operands produces a line of output
7973 $ stat --format=%d:%i / /usr
7978 Use FORMAT rather than the default format. Like `--format', but
7979 interpret backslash escapes, and do not output a mandatory
7980 trailing newline. If you want a newline, include `\n' in the
7981 FORMAT. Here's how you would use `--printf' to print the device
7982 and inode numbers of `/' and `/usr':
7983 $ stat --printf='%d:%i\n' / /usr
7989 Print the information in terse form, suitable for parsing by other
7992 The valid format sequences for files are:
7994 * %a - Access rights in octal
7996 * %A - Access rights in human readable form
7998 * %b - Number of blocks allocated (see `%B')
8000 * %B - The size in bytes of each block reported by `%b'
8002 * %d - Device number in decimal
8004 * %D - Device number in hex
8006 * %f - Raw mode in hex
8010 * %g - Group ID of owner
8012 * %G - Group name of owner
8014 * %h - Number of hard links
8020 * %N - Quoted file name with dereference if symbolic link
8022 * %o - I/O block size
8024 * %s - Total size, in bytes
8026 * %t - Major device type in hex
8028 * %T - Minor device type in hex
8030 * %u - User ID of owner
8032 * %U - User name of owner
8034 * %x - Time of last access
8036 * %X - Time of last access as seconds since Epoch
8038 * %y - Time of last modification
8040 * %Y - Time of last modification as seconds since Epoch
8042 * %z - Time of last change
8044 * %Z - Time of last change as seconds since Epoch
8046 The valid format sequences for file systems are:
8048 * %a - Free blocks available to non-super-user
8050 * %b - Total data blocks in file system
8052 * %c - Total file nodes in file system
8054 * %d - Free file nodes in file system
8056 * %f - Free blocks in file system
8058 * %i - File System ID in hex
8060 * %l - Maximum length of file names
8064 * %s - Block size (for faster transfers)
8066 * %S - Fundamental block size (for block counts)
8070 * %T - Type in human readable form
8072 Time stamps are listed according to the time zone rules specified
8073 by the `TZ' environment variable, or by the system default rules if
8074 `TZ' is not set. *Note Specifying the Time Zone with `TZ':
8077 An exit status of zero indicates success, and a nonzero value
8081 File: coreutils.info, Node: sync invocation, Prev: stat invocation, Up: Disk usage
8083 14.4 `sync': Synchronize data on disk with memory
8084 =================================================
8086 `sync' writes any data buffered in memory out to disk. This can
8087 include (but is not limited to) modified superblocks, modified inodes,
8088 and delayed reads and writes. This must be implemented by the kernel;
8089 The `sync' program does nothing but exercise the `sync' system call.
8091 The kernel keeps data in memory to avoid doing (relatively slow) disk
8092 reads and writes. This improves performance, but if the computer
8093 crashes, data may be lost or the file system corrupted as a result.
8094 The `sync' command ensures everything in memory is written to disk.
8096 Any arguments are ignored, except for a lone `--help' or `--version'
8097 (*note Common options::).
8099 An exit status of zero indicates success, and a nonzero value
8103 File: coreutils.info, Node: Printing text, Next: Conditions, Prev: Disk usage, Up: Top
8108 This section describes commands that display text strings.
8112 * echo invocation:: Print a line of text.
8113 * printf invocation:: Format and print data.
8114 * yes invocation:: Print a string until interrupted.
8117 File: coreutils.info, Node: echo invocation, Next: printf invocation, Up: Printing text
8119 15.1 `echo': Print a line of text
8120 =================================
8122 `echo' writes each given STRING to standard output, with a space
8123 between each and a newline after the last one. Synopsis:
8125 echo [OPTION]... [STRING]...
8127 The program accepts the following options. Also see *Note Common
8128 options::. Options must precede operands, and the normally-special
8129 argument `--' has no special meaning and is treated like any other
8133 Do not output the trailing newline.
8136 Enable interpretation of the following backslash-escaped
8137 characters in each STRING:
8146 suppress trailing newline
8167 the eight-bit value that is the octal number NNN (zero to
8171 the eight-bit value that is the octal number NNN (one to
8175 the eight-bit value that is the hexadecimal number HH (one or
8176 two hexadecimal digits)
8179 Disable interpretation of backslash escapes in each STRING. This
8180 is the default. If `-e' and `-E' are both specified, the last one
8184 If the `POSIXLY_CORRECT' environment variable is set, then when
8185 `echo''s first argument is not `-n' it outputs option-like arguments
8186 instead of treating them as options. For example, `echo -ne hello'
8187 outputs `-ne hello' instead of plain `hello'.
8189 POSIX does not require support for any options, and says that the
8190 behavior of `echo' is implementation-defined if any STRING contains a
8191 backslash or if the first argument is `-n'. Portable programs can use
8192 the `printf' command if they need to omit trailing newlines or output
8193 control characters or backslashes. *Note printf invocation::.
8195 An exit status of zero indicates success, and a nonzero value
8199 File: coreutils.info, Node: printf invocation, Next: yes invocation, Prev: echo invocation, Up: Printing text
8201 15.2 `printf': Format and print data
8202 ====================================
8204 `printf' does formatted printing of text. Synopsis:
8206 printf FORMAT [ARGUMENT]...
8208 `printf' prints the FORMAT string, interpreting `%' directives and
8209 `\' escapes to format numeric and string arguments in a way that is
8210 mostly similar to the C `printf' function. The differences are as
8213 * The FORMAT argument is reused as necessary to convert all the
8214 given ARGUMENTs. For example, the command `printf %s a b' outputs
8217 * Missing ARGUMENTs are treated as null strings or as zeros,
8218 depending on whether the context expects a string or a number. For
8219 example, the command `printf %sx%d' prints `x0'.
8221 * An additional escape, `\c', causes `printf' to produce no further
8222 output. For example, the command `printf 'A%sC\cD%sF' B E' prints
8225 * The hexadecimal escape sequence `\xHH' has at most two digits, as
8226 opposed to C where it can have an unlimited number of digits. For
8227 example, the command `printf '\x07e'' prints two bytes, whereas
8228 the C statement `printf ("\x07e")' prints just one.
8230 * `printf' has an additional directive, `%b', which prints its
8231 argument string with `\' escapes interpreted in the same way as in
8232 the FORMAT string, except that octal escapes are of the form
8233 `\0OOO' where OOO is 0 to 3 octal digits. If a precision is also
8234 given, it limits the number of bytes printed from the converted
8237 * Numeric arguments must be single C constants, possibly with leading
8238 `+' or `-'. For example, `printf %.4d -3' outputs `-0003'.
8240 * If the leading character of a numeric argument is `"' or `'' then
8241 its value is the numeric value of the immediately following
8242 character. Any remaining characters are silently ignored if the
8243 `POSIXLY_CORRECT' environment variable is set; otherwise, a
8244 warning is printed. For example, `printf "%d" "'a"' outputs `97'
8245 on hosts that use the ASCII character set, since `a' has the
8246 numeric value 97 in ASCII.
8249 A floating-point argument must use a period before any fractional
8250 digits, but is printed according to the `LC_NUMERIC' category of the
8251 current locale. For example, in a locale whose radix character is a
8252 comma, the command `printf %g 3.14' outputs `3,14' whereas the command
8253 `printf %g 3,14' is an error.
8255 `printf' interprets `\OOO' in FORMAT as an octal number (if OOO is 1
8256 to 3 octal digits) specifying a character to print, and `\xHH' as a
8257 hexadecimal number (if HH is 1 to 2 hex digits) specifying a character
8260 `printf' interprets two character syntaxes introduced in ISO C 99:
8261 `\u' for 16-bit Unicode (ISO/IEC 10646) characters, specified as four
8262 hexadecimal digits HHHH, and `\U' for 32-bit Unicode characters,
8263 specified as eight hexadecimal digits HHHHHHHH. `printf' outputs the
8264 Unicode characters according to the `LC_CTYPE' locale.
8266 The processing of `\u' and `\U' requires a full-featured `iconv'
8267 facility. It is activated on systems with glibc 2.2 (or newer), or
8268 when `libiconv' is installed prior to this package. Otherwise `\u' and
8269 `\U' will print as-is.
8271 The only options are a lone `--help' or `--version'. *Note Common
8272 options::. Options must precede operands.
8274 The Unicode character syntaxes are useful for writing strings in a
8275 locale independent way. For example, a string containing the Euro
8278 $ /usr/local/bin/printf '\u20AC 14.95'
8280 will be output correctly in all locales supporting the Euro symbol
8281 (ISO-8859-15, UTF-8, and others). Similarly, a Chinese string
8283 $ /usr/local/bin/printf '\u4e2d\u6587'
8285 will be output correctly in all Chinese locales (GB2312, BIG5, UTF-8,
8288 Note that in these examples, the full name of `printf' has been
8289 given, to distinguish it from the GNU `bash' built-in function `printf'.
8291 For larger strings, you don't need to look up the hexadecimal code
8292 values of each character one by one. ASCII characters mixed with \u
8293 escape sequences is also known as the JAVA source file encoding. You
8294 can use GNU recode 3.5c (or newer) to convert strings to this encoding.
8295 Here is how to convert a piece of text into a shell script which will
8296 output this text in a locale-independent way:
8298 $ LC_CTYPE=zh_CN.big5 /usr/local/bin/printf \
8299 '\u4e2d\u6587\n' > sample.txt
8300 $ recode BIG5..JAVA < sample.txt \
8301 | sed -e "s|^|/usr/local/bin/printf '|" -e "s|$|\\\\n'|" \
8304 An exit status of zero indicates success, and a nonzero value
8308 File: coreutils.info, Node: yes invocation, Prev: printf invocation, Up: Printing text
8310 15.3 `yes': Print a string until interrupted
8311 ============================================
8313 `yes' prints the command line arguments, separated by spaces and
8314 followed by a newline, forever until it is killed. If no arguments are
8315 given, it prints `y' followed by a newline forever until killed.
8317 Upon a write error, `yes' exits with status `1'.
8319 The only options are a lone `--help' or `--version'. To output an
8320 argument that begins with `-', precede it with `--', e.g., `yes --
8321 --help'. *Note Common options::.
8324 File: coreutils.info, Node: Conditions, Next: Redirection, Prev: Printing text, Up: Top
8329 This section describes commands that are primarily useful for their exit
8330 status, rather than their output. Thus, they are often used as the
8331 condition of shell `if' statements, or as the last command in a
8336 * false invocation:: Do nothing, unsuccessfully.
8337 * true invocation:: Do nothing, successfully.
8338 * test invocation:: Check file types and compare values.
8339 * expr invocation:: Evaluate expressions.
8342 File: coreutils.info, Node: false invocation, Next: true invocation, Up: Conditions
8344 16.1 `false': Do nothing, unsuccessfully
8345 ========================================
8347 `false' does nothing except return an exit status of 1, meaning
8348 "failure". It can be used as a place holder in shell scripts where an
8349 unsuccessful command is needed. In most modern shells, `false' is a
8350 built-in command, so when you use `false' in a script, you're probably
8351 using the built-in command, not the one documented here.
8353 `false' honors the `--help' and `--version' options.
8355 This version of `false' is implemented as a C program, and is thus
8356 more secure and faster than a shell script implementation, and may
8357 safely be used as a dummy shell for the purpose of disabling accounts.
8359 Note that `false' (unlike all other programs documented herein)
8360 exits unsuccessfully, even when invoked with `--help' or `--version'.
8362 Portable programs should not assume that the exit status of `false'
8363 is 1, as it is greater than 1 on some non-GNU hosts.
8366 File: coreutils.info, Node: true invocation, Next: test invocation, Prev: false invocation, Up: Conditions
8368 16.2 `true': Do nothing, successfully
8369 =====================================
8371 `true' does nothing except return an exit status of 0, meaning
8372 "success". It can be used as a place holder in shell scripts where a
8373 successful command is needed, although the shell built-in command `:'
8374 (colon) may do the same thing faster. In most modern shells, `true' is
8375 a built-in command, so when you use `true' in a script, you're probably
8376 using the built-in command, not the one documented here.
8378 `true' honors the `--help' and `--version' options.
8380 Note, however, that it is possible to cause `true' to exit with
8381 nonzero status: with the `--help' or `--version' option, and with
8382 standard output already closed or redirected to a file that evokes an
8383 I/O error. For example, using a Bourne-compatible shell:
8385 $ ./true --version >&-
8386 ./true: write error: Bad file number
8387 $ ./true --version > /dev/full
8388 ./true: write error: No space left on device
8390 This version of `true' is implemented as a C program, and is thus
8391 more secure and faster than a shell script implementation, and may
8392 safely be used as a dummy shell for the purpose of disabling accounts.
8395 File: coreutils.info, Node: test invocation, Next: expr invocation, Prev: true invocation, Up: Conditions
8397 16.3 `test': Check file types and compare values
8398 ================================================
8400 `test' returns a status of 0 (true) or 1 (false) depending on the
8401 evaluation of the conditional expression EXPR. Each part of the
8402 expression must be a separate argument.
8404 `test' has file status checks, string operators, and numeric
8405 comparison operators.
8407 `test' has an alternate form that uses opening and closing square
8408 brackets instead a leading `test'. For example, instead of `test -d
8409 /', you can write `[ -d / ]'. The square brackets must be separate
8410 arguments; for example, `[-d /]' does not have the desired effect.
8411 Since `test EXPR' and `[ EXPR ]' have the same meaning, only the former
8412 form is discussed below.
8422 Because most shells have a built-in `test' command, using an
8423 unadorned `test' in a script or interactively may get you different
8424 functionality than that described here.
8426 If EXPRESSION is omitted, `test' returns false. If EXPRESSION is a
8427 single argument, `test' returns false if the argument is null and true
8428 otherwise. The argument can be any string, including strings like
8429 `-d', `-1', `--', `--help', and `--version' that most other programs
8430 would treat as options. To get help and version information, invoke
8431 the commands `[ --help' and `[ --version', without the usual closing
8432 brackets. *Note Common options::.
8436 0 if the expression is true,
8437 1 if the expression is false,
8438 2 if an error occurred.
8442 * File type tests:: -[bcdfhLpSt]
8443 * Access permission tests:: -[gkruwxOG]
8444 * File characteristic tests:: -e -s -nt -ot -ef
8445 * String tests:: -z -n = !=
8446 * Numeric tests:: -eq -ne -lt -le -gt -ge
8447 * Connectives for test:: ! -a -o
8450 File: coreutils.info, Node: File type tests, Next: Access permission tests, Up: test invocation
8452 16.3.1 File type tests
8453 ----------------------
8455 These options test for particular types of files. (Everything's a file,
8456 but not all files are the same!)
8459 True if FILE exists and is a block special device.
8462 True if FILE exists and is a character special device.
8465 True if FILE exists and is a directory.
8468 True if FILE exists and is a regular file.
8472 True if FILE exists and is a symbolic link. Unlike all other
8473 file-related tests, this test does not dereference FILE if it is a
8477 True if FILE exists and is a named pipe.
8480 True if FILE exists and is a socket.
8483 True if FD is a file descriptor that is associated with a terminal.
8487 File: coreutils.info, Node: Access permission tests, Next: File characteristic tests, Prev: File type tests, Up: test invocation
8489 16.3.2 Access permission tests
8490 ------------------------------
8492 These options test for particular access permissions.
8495 True if FILE exists and has its set-group-ID bit set.
8498 True if FILE exists and has its "sticky" bit set.
8501 True if FILE exists and read permission is granted.
8504 True if FILE exists and has its set-user-ID bit set.
8507 True if FILE exists and write permission is granted.
8510 True if FILE exists and execute permission is granted (or search
8511 permission, if it is a directory).
8514 True if FILE exists and is owned by the current effective user ID.
8517 True if FILE exists and is owned by the current effective group ID.
8521 File: coreutils.info, Node: File characteristic tests, Next: String tests, Prev: Access permission tests, Up: test invocation
8523 16.3.3 File characteristic tests
8524 --------------------------------
8526 These options test other file characteristics.
8529 True if FILE exists.
8532 True if FILE exists and has a size greater than zero.
8535 True if FILE1 is newer (according to modification date) than
8536 FILE2, or if FILE1 exists and FILE2 does not.
8539 True if FILE1 is older (according to modification date) than
8540 FILE2, or if FILE2 exists and FILE1 does not.
8543 True if FILE1 and FILE2 have the same device and inode numbers,
8544 i.e., if they are hard links to each other.
8548 File: coreutils.info, Node: String tests, Next: Numeric tests, Prev: File characteristic tests, Up: test invocation
8553 These options test string characteristics. You may need to quote
8554 STRING arguments for the shell. For example:
8558 The quotes here prevent the wrong arguments from being passed to
8559 `test' if `$V' is empty or contains special characters.
8562 True if the length of STRING is zero.
8566 True if the length of STRING is nonzero.
8569 True if the strings are equal.
8571 `STRING1 != STRING2'
8572 True if the strings are not equal.
8576 File: coreutils.info, Node: Numeric tests, Next: Connectives for test, Prev: String tests, Up: test invocation
8578 16.3.5 Numeric tests
8579 --------------------
8581 Numeric relationals. The arguments must be entirely numeric (possibly
8582 negative), or the special expression `-l STRING', which evaluates to
8583 the length of STRING.
8591 These arithmetic binary operators return true if ARG1 is equal,
8592 not-equal, less-than, less-than-or-equal, greater-than, or
8593 greater-than-or-equal than ARG2, respectively.
8598 test -1 -gt -2 && echo yes
8600 test -l abc -gt 1 && echo yes
8603 error--> test: integer expression expected before -eq
8606 File: coreutils.info, Node: Connectives for test, Prev: Numeric tests, Up: test invocation
8608 16.3.6 Connectives for `test'
8609 -----------------------------
8611 The usual logical connectives.
8614 True if EXPR is false.
8617 True if both EXPR1 and EXPR2 are true.
8620 True if either EXPR1 or EXPR2 is true.
8624 File: coreutils.info, Node: expr invocation, Prev: test invocation, Up: Conditions
8626 16.4 `expr': Evaluate expressions
8627 =================================
8629 `expr' evaluates an expression and writes the result on standard
8630 output. Each token of the expression must be a separate argument.
8632 Operands are either integers or strings. Integers consist of one or
8633 more decimal digits, with an optional leading `-'. `expr' converts
8634 anything appearing in an operand position to an integer or a string
8635 depending on the operation being applied to it.
8637 Strings are not quoted for `expr' itself, though you may need to
8638 quote them to protect characters with special meaning to the shell,
8639 e.g., spaces. However, regardless of whether it is quoted, a string
8640 operand should not be a parenthesis or any of `expr''s operators like
8641 `+', so you cannot safely pass an arbitrary string `$str' to expr
8642 merely by quoting it to the shell. One way to work around this is to
8643 use the GNU extension `+', (e.g., `+ "$str" = foo'); a more portable
8644 way is to use `" $str"' and to adjust the rest of the expression to take
8645 the leading space into account (e.g., `" $str" = " foo"').
8647 You should not pass a negative integer or a string with leading `-'
8648 as `expr''s first argument, as it might be misinterpreted as an option;
8649 this can be avoided by parenthesization. Also, portable scripts should
8650 not use a string operand that happens to take the form of an integer;
8651 this can be worked around by inserting leading spaces as mentioned
8654 Operators may be given as infix symbols or prefix keywords.
8655 Parentheses may be used for grouping in the usual manner. You must
8656 quote parentheses and many operators to avoid the shell evaluating them,
8659 The only options are `--help' and `--version'. *Note Common
8660 options::. Options must precede operands.
8664 0 if the expression is neither null nor 0,
8665 1 if the expression is null or 0,
8666 2 if the expression is invalid,
8667 3 if an internal error occurred (e.g., arithmetic overflow).
8671 * String expressions:: + : match substr index length
8672 * Numeric expressions:: + - * / %
8673 * Relations for expr:: | & < <= = == != >= >
8674 * Examples of expr:: Examples.
8677 File: coreutils.info, Node: String expressions, Next: Numeric expressions, Up: expr invocation
8679 16.4.1 String expressions
8680 -------------------------
8682 `expr' supports pattern matching and other string operators. These
8683 have lower precedence than both the numeric and relational operators (in
8687 Perform pattern matching. The arguments are converted to strings
8688 and the second is considered to be a (basic, a la GNU `grep')
8689 regular expression, with a `^' implicitly prepended. The first
8690 argument is then matched against this regular expression.
8692 If the match succeeds and REGEX uses `\(' and `\)', the `:'
8693 expression returns the part of STRING that matched the
8694 subexpression; otherwise, it returns the number of characters
8697 If the match fails, the `:' operator returns the null string if
8698 `\(' and `\)' are used in REGEX, otherwise 0.
8700 Only the first `\( ... \)' pair is relevant to the return value;
8701 additional pairs are meaningful only for grouping the regular
8702 expression operators.
8704 In the regular expression, `\+', `\?', and `\|' are operators
8705 which respectively match one or more, zero or one, or separate
8706 alternatives. SunOS and other `expr''s treat these as regular
8707 characters. (POSIX allows either behavior.) *Note Regular
8708 Expression Library: (regex)Top, for details of regular expression
8709 syntax. Some examples are in *Note Examples of expr::.
8711 `match STRING REGEX'
8712 An alternative way to do pattern matching. This is the same as
8715 `substr STRING POSITION LENGTH'
8716 Returns the substring of STRING beginning at POSITION with length
8717 at most LENGTH. If either POSITION or LENGTH is negative, zero,
8718 or non-numeric, returns the null string.
8720 `index STRING CHARSET'
8721 Returns the first position in STRING where the first character in
8722 CHARSET was found. If no character in CHARSET is found in STRING,
8726 Returns the length of STRING.
8729 Interpret TOKEN as a string, even if it is a keyword like MATCH or
8730 an operator like `/'. This makes it possible to test `expr length
8731 + "$x"' or `expr + "$x" : '.*/\(.\)'' and have it do the right
8732 thing even if the value of $X happens to be (for example) `/' or
8733 `index'. This operator is a GNU extension. Portable shell
8734 scripts should use `" $token" : ' \(.*\)'' instead of `+ "$token"'.
8737 To make `expr' interpret keywords as strings, you must use the
8741 File: coreutils.info, Node: Numeric expressions, Next: Relations for expr, Prev: String expressions, Up: expr invocation
8743 16.4.2 Numeric expressions
8744 --------------------------
8746 `expr' supports the usual numeric operators, in order of increasing
8747 precedence. The string operators (previous section) have lower
8748 precedence, the connectives (next section) have higher.
8751 Addition and subtraction. Both arguments are converted to
8752 integers; an error occurs if this cannot be done.
8755 Multiplication, division, remainder. Both arguments are converted
8756 to integers; an error occurs if this cannot be done.
8760 File: coreutils.info, Node: Relations for expr, Next: Examples of expr, Prev: Numeric expressions, Up: expr invocation
8762 16.4.3 Relations for `expr'
8763 ---------------------------
8765 `expr' supports the usual logical connectives and relations. These are
8766 higher precedence than either the string or numeric operators (previous
8767 sections). Here is the list, lowest-precedence operator first.
8770 Returns its first argument if that is neither null nor zero,
8771 otherwise its second argument if it is neither null nor zero,
8772 otherwise 0. It does not evaluate its second argument if its
8773 first argument is neither null nor zero.
8776 Return its first argument if neither argument is null or zero,
8777 otherwise 0. It does not evaluate its second argument if its
8778 first argument is null or zero.
8781 Compare the arguments and return 1 if the relation is true, 0
8782 otherwise. `==' is a synonym for `='. `expr' first tries to
8783 convert both arguments to integers and do a numeric comparison; if
8784 either conversion fails, it does a lexicographic comparison using
8785 the character collating sequence specified by the `LC_COLLATE'
8790 File: coreutils.info, Node: Examples of expr, Prev: Relations for expr, Up: expr invocation
8792 16.4.4 Examples of using `expr'
8793 -------------------------------
8795 Here are a few examples, including quoting for shell metacharacters.
8797 To add 1 to the shell variable `foo', in Bourne-compatible shells:
8801 To print the non-directory part of the file name stored in `$fname',
8802 which need not contain a `/':
8804 expr $fname : '.*/\(.*\)' '|' $fname
8806 An example showing that `\+' is an operator:
8811 expr abc : 'a\(.\)c'
8813 expr index abcdef cz
8816 error--> expr: syntax error
8817 expr index quote index a
8821 File: coreutils.info, Node: Redirection, Next: File name manipulation, Prev: Conditions, Up: Top
8826 Unix shells commonly provide several forms of "redirection"--ways to
8827 change the input source or output destination of a command. But one
8828 useful redirection is performed by a separate command, not by the shell;
8829 it's described here.
8833 * tee invocation:: Redirect output to multiple files.
8836 File: coreutils.info, Node: tee invocation, Up: Redirection
8838 17.1 `tee': Redirect output to multiple files
8839 =============================================
8841 The `tee' command copies standard input to standard output and also to
8842 any files given as arguments. This is useful when you want not only to
8843 send some data down a pipe, but also to save a copy. Synopsis:
8845 tee [OPTION]... [FILE]...
8847 If a file being written to does not already exist, it is created.
8848 If a file being written to already exists, the data it previously
8849 contained is overwritten unless the `-a' option is used.
8851 A FILE of `-' causes `tee' to send another copy of input to standard
8852 output, but this is typically not that useful as the copies are
8855 The program accepts the following options. Also see *Note Common
8860 Append standard input to the given files rather than overwriting
8864 `--ignore-interrupts'
8865 Ignore interrupt signals.
8868 An exit status of zero indicates success, and a nonzero value
8872 File: coreutils.info, Node: File name manipulation, Next: Working context, Prev: Redirection, Up: Top
8874 18 File name manipulation
8875 *************************
8877 This section describes commands that manipulate file names.
8881 * basename invocation:: Strip directory and suffix from a file name.
8882 * dirname invocation:: Strip non-directory suffix from a file name.
8883 * pathchk invocation:: Check file name portability.
8886 File: coreutils.info, Node: basename invocation, Next: dirname invocation, Up: File name manipulation
8888 18.1 `basename': Strip directory and suffix from a file name
8889 ============================================================
8891 `basename' removes any leading directory components from NAME.
8894 basename NAME [SUFFIX]
8896 If SUFFIX is specified and is identical to the end of NAME, it is
8897 removed from NAME as well. Note that since trailing slashes are
8898 removed prior to suffix matching, SUFFIX will do nothing if it contains
8899 slashes. `basename' prints the result on standard output.
8901 Together, `basename' and `dirname' are designed such that if `ls
8902 "$name"' succeeds, then the command sequence `cd "$(dirname "$name")";
8903 ls "$(basename "$name")"' will, too. This works for everything except
8904 file names containing a trailing newline.
8906 POSIX allows the implementation to define the results if NAME is
8907 empty or `//'. In the former case, GNU `basename' returns the empty
8908 string. In the latter case, the result is `//' on platforms where //
8909 is distinct from /, and `/' on platforms where there is no difference.
8911 The only options are `--help' and `--version'. *Note Common
8912 options::. Options must precede operands.
8914 An exit status of zero indicates success, and a nonzero value
8920 basename /usr/bin/sort
8923 basename include/stdio.h .h
8926 File: coreutils.info, Node: dirname invocation, Next: pathchk invocation, Prev: basename invocation, Up: File name manipulation
8928 18.2 `dirname': Strip non-directory suffix from a file name
8929 ===========================================================
8931 `dirname' prints all but the final slash-delimited component of a
8932 string (presumably a file name). Synopsis:
8936 If NAME is a single component, `dirname' prints `.' (meaning the
8939 Together, `basename' and `dirname' are designed such that if `ls
8940 "$name"' succeeds, then the command sequence `cd "$(dirname "$name")";
8941 ls "$(basename "$name")"' will, too. This works for everything except
8942 file names containing a trailing newline.
8944 POSIX allows the implementation to define the results if NAME is
8945 `//'. With GNU `dirname', the result is `//' on platforms where // is
8946 distinct from /, and `/' on platforms where there is no difference.
8948 The only options are `--help' and `--version'. *Note Common
8951 An exit status of zero indicates success, and a nonzero value
8956 # Output "/usr/bin".
8957 dirname /usr/bin/sort
8963 File: coreutils.info, Node: pathchk invocation, Prev: dirname invocation, Up: File name manipulation
8965 18.3 `pathchk': Check file name portability
8966 ===========================================
8968 `pathchk' checks portability of file names. Synopsis:
8970 pathchk [OPTION]... NAME...
8972 For each NAME, `pathchk' prints a message if any of these conditions
8975 1. One of the existing directories in NAME does not have search
8976 (execute) permission,
8978 2. The length of NAME is larger than the maximum supported by the
8981 3. The length of one component of NAME is longer than its file
8984 A nonexistent NAME is not an error, so long a file with that name
8985 could be created under the above conditions.
8987 The program accepts the following options. Also see *Note Common
8988 options::. Options must precede operands.
8991 Instead of performing checks based on the underlying file system,
8992 print a message if any of these conditions is true:
8994 1. A file name is empty.
8996 2. The length of a file name or one of its components exceeds the
8997 POSIX minimum limits for portability.
8999 3. A file name contains a character outside the portable file
9000 name character set, namely, the ASCII letters and digits, `-',
9004 Print a message if a file name is empty, or if it contains a
9005 component that begins with `-'.
9008 Print a message if a file name is not portable to all POSIX hosts.
9009 This option is equivalent to `-p -P'.
9014 0 if all specified file names passed all checks,
9018 File: coreutils.info, Node: Working context, Next: User information, Prev: File name manipulation, Up: Top
9023 This section describes commands that display or alter the context in
9024 which you are working: the current directory, the terminal settings, and
9025 so forth. See also the user-related commands in the next section.
9029 * pwd invocation:: Print working directory.
9030 * stty invocation:: Print or change terminal characteristics.
9031 * printenv invocation:: Print environment variables.
9032 * tty invocation:: Print file name of terminal on standard input.
9035 File: coreutils.info, Node: pwd invocation, Next: stty invocation, Up: Working context
9037 19.1 `pwd': Print working directory
9038 ===================================
9040 `pwd' prints the fully resolved name of the current directory. That
9041 is, all components of the printed name will be actual directory
9042 names--none will be symbolic links.
9044 Because most shells have a built-in `pwd' command, using an
9045 unadorned `pwd' in a script or interactively may get you different
9046 functionality than that described here.
9048 The only options are a lone `--help' or `--version'. *Note Common
9051 An exit status of zero indicates success, and a nonzero value
9055 File: coreutils.info, Node: stty invocation, Next: printenv invocation, Prev: pwd invocation, Up: Working context
9057 19.2 `stty': Print or change terminal characteristics
9058 =====================================================
9060 `stty' prints or changes terminal characteristics, such as baud rate.
9063 stty [OPTION] [SETTING]...
9066 If given no line settings, `stty' prints the baud rate, line
9067 discipline number (on systems that support it), and line settings that
9068 have been changed from the values set by `stty sane'. By default, mode
9069 reading and setting are performed on the tty line connected to standard
9070 input, although this can be modified by the `--file' option.
9072 `stty' accepts many non-option arguments that change aspects of the
9073 terminal line operation, as described below.
9075 The program accepts the following options. Also see *Note Common
9080 Print all current settings in human-readable form. This option
9081 may not be used in combination with any line settings.
9085 Set the line opened by the file name specified in DEVICE instead of
9086 the tty line connected to standard input. This option is necessary
9087 because opening a POSIX tty requires use of the `O_NONDELAY' flag
9088 to prevent a POSIX tty from blocking until the carrier detect line
9089 is high if the `clocal' flag is not set. Hence, it is not always
9090 possible to allow the shell to open the device in the traditional
9095 Print all current settings in a form that can be used as an
9096 argument to another `stty' command to restore the current
9097 settings. This option may not be used in combination with any
9101 Many settings can be turned off by preceding them with a `-'. Such
9102 arguments are marked below with "May be negated" in their description.
9103 The descriptions themselves refer to the positive case, that is, when
9104 _not_ negated (unless stated otherwise, of course).
9106 Some settings are not available on all POSIX systems, since they use
9107 extensions. Such arguments are marked below with "Non-POSIX" in their
9108 description. On non-POSIX systems, those or other settings also may not
9109 be available, but it's not feasible to document all the variations: just
9112 An exit status of zero indicates success, and a nonzero value
9117 * Control:: Control settings
9118 * Input:: Input settings
9119 * Output:: Output settings
9120 * Local:: Local settings
9121 * Combination:: Combination settings
9122 * Characters:: Special characters
9123 * Special:: Special settings
9126 File: coreutils.info, Node: Control, Next: Input, Up: stty invocation
9128 19.2.1 Control settings
9129 -----------------------
9134 Generate parity bit in output and expect parity bit in input. May
9138 Set odd parity (even if negated). May be negated.
9144 Set character size to 5, 6, 7, or 8 bits.
9148 Send a hangup signal when the last process closes the tty. May be
9152 Use two stop bits per character (one if negated). May be negated.
9155 Allow input to be received. May be negated.
9158 Disable modem control signals. May be negated.
9161 Enable RTS/CTS flow control. Non-POSIX. May be negated.
9164 File: coreutils.info, Node: Input, Next: Output, Prev: Control, Up: stty invocation
9166 19.2.2 Input settings
9167 ---------------------
9170 Ignore break characters. May be negated.
9173 Make breaks cause an interrupt signal. May be negated.
9176 Ignore characters with parity errors. May be negated.
9179 Mark parity errors (with a 255-0-character sequence). May be
9183 Enable input parity checking. May be negated.
9186 Clear high (8th) bit of input characters. May be negated.
9189 Translate newline to carriage return. May be negated.
9192 Ignore carriage return. May be negated.
9195 Translate carriage return to newline. May be negated.
9198 Assume input characters are UTF-8 encoded. May be negated.
9201 Enable XON/XOFF flow control (that is, `CTRL-S'/`CTRL-Q'). May be
9206 Enable sending of `stop' character when the system input buffer is
9207 almost full, and `start' character when it becomes almost empty
9208 again. May be negated.
9211 Translate uppercase characters to lowercase. Non-POSIX. May be
9215 Allow any character to restart output (only the start character if
9216 negated). Non-POSIX. May be negated.
9219 Enable beeping and not flushing input buffer if a character arrives
9220 when the input buffer is full. Non-POSIX. May be negated.
9223 File: coreutils.info, Node: Output, Next: Local, Prev: Input, Up: stty invocation
9225 19.2.3 Output settings
9226 ----------------------
9228 These arguments specify output-related operations.
9231 Postprocess output. May be negated.
9234 Translate lowercase characters to uppercase. Non-POSIX. May be
9238 Translate carriage return to newline. Non-POSIX. May be negated.
9241 Translate newline to carriage return-newline. Non-POSIX. May be
9245 Do not print carriage returns in the first column. Non-POSIX.
9249 Newline performs a carriage return. Non-POSIX. May be negated.
9252 Use fill (padding) characters instead of timing for delays.
9253 Non-POSIX. May be negated.
9256 Use delete characters for fill instead of null characters.
9257 Non-POSIX. May be negated.
9261 Newline delay style. Non-POSIX.
9267 Carriage return delay style. Non-POSIX.
9273 Horizontal tab delay style. Non-POSIX.
9277 Backspace delay style. Non-POSIX.
9281 Vertical tab delay style. Non-POSIX.
9285 Form feed delay style. Non-POSIX.
9288 File: coreutils.info, Node: Local, Next: Combination, Prev: Output, Up: stty invocation
9290 19.2.4 Local settings
9291 ---------------------
9294 Enable `interrupt', `quit', and `suspend' special characters. May
9298 Enable `erase', `kill', `werase', and `rprnt' special characters.
9302 Enable non-POSIX special characters. May be negated.
9305 Echo input characters. May be negated.
9309 Echo `erase' characters as backspace-space-backspace. May be
9313 Echo a newline after a `kill' character. May be negated.
9316 Echo newline even if not echoing other characters. May be negated.
9319 Disable flushing after `interrupt' and `quit' special characters.
9323 Enable input and output of uppercase characters by preceding their
9324 lowercase equivalents with `\', when `icanon' is set. Non-POSIX.
9328 Stop background jobs that try to write to the terminal. Non-POSIX.
9333 Echo erased characters backward, between `\' and `/'. Non-POSIX.
9338 Echo control characters in hat notation (`^C') instead of
9339 literally. Non-POSIX. May be negated.
9343 Echo the `kill' special character by erasing each character on the
9344 line as indicated by the `echoprt' and `echoe' settings, instead
9345 of by the `echoctl' and `echok' settings. Non-POSIX. May be
9349 File: coreutils.info, Node: Combination, Next: Characters, Prev: Local, Up: stty invocation
9351 19.2.5 Combination settings
9352 ---------------------------
9354 Combination settings:
9358 Same as `parenb -parodd cs7'. May be negated. If negated, same
9362 Same as `parenb parodd cs7'. May be negated. If negated, same as
9366 Same as `-icrnl -onlcr'. May be negated. If negated, same as
9367 `icrnl -inlcr -igncr onlcr -ocrnl -onlret'.
9370 Reset the `erase' and `kill' special characters to their default
9376 cread -ignbrk brkint -inlcr -igncr icrnl -ixoff
9377 -iuclc -ixany imaxbel opost -olcuc -ocrnl onlcr
9378 -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0
9379 ff0 isig icanon iexten echo echoe echok -echonl
9380 -noflsh -xcase -tostop -echoprt echoctl echoke
9382 and also sets all special characters to their default values.
9385 Same as `brkint ignpar istrip icrnl ixon opost isig icanon', plus
9386 sets the `eof' and `eol' characters to their default values if
9387 they are the same as the `min' and `time' characters. May be
9388 negated. If negated, same as `raw'.
9393 -ignbrk -brkint -ignpar -parmrk -inpck -istrip
9394 -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany
9395 -imaxbel -opost -isig -icanon -xcase min 1 time 0
9397 May be negated. If negated, same as `cooked'.
9400 Same as `-icanon'. May be negated. If negated, same as `icanon'.
9403 Same as `-parenb -istrip cs8'. May be negated. If negated, same
9404 as `parenb istrip cs7'.
9407 Same as `-parenb -istrip -opost cs8'. May be negated. If
9408 negated, same as `parenb istrip opost cs7'.
9411 Same as `-ixany'. Non-POSIX. May be negated.
9414 Same as `tab0'. Non-POSIX. May be negated. If negated, same as
9419 Same as `xcase iuclc olcuc'. Non-POSIX. May be negated.
9422 Same as `echoe echoctl echoke'.
9425 Same as `echoe echoctl echoke -ixany intr ^C erase ^? kill C-u'.
9428 File: coreutils.info, Node: Characters, Next: Special, Prev: Combination, Up: stty invocation
9430 19.2.6 Special characters
9431 -------------------------
9433 The special characters' default values vary from system to system.
9434 They are set with the syntax `name value', where the names are listed
9435 below and the value can be given either literally, in hat notation
9436 (`^C'), or as an integer which may start with `0x' to indicate
9437 hexadecimal, `0' to indicate octal, or any other digit to indicate
9440 For GNU stty, giving a value of `^-' or `undef' disables that
9441 special character. (This is incompatible with Ultrix `stty', which
9442 uses a value of `u' to disable a special character. GNU `stty' treats
9443 a value `u' like any other, namely to set that special character to
9447 Send an interrupt signal.
9453 Erase the last character typed.
9456 Erase the current line.
9459 Send an end of file (terminate the input).
9465 Alternate character to end the line. Non-POSIX.
9468 Switch to a different shell layer. Non-POSIX.
9471 Restart the output after stopping it.
9477 Send a terminal stop signal.
9480 Send a terminal stop signal after flushing the input. Non-POSIX.
9483 Redraw the current line. Non-POSIX.
9486 Erase the last word typed. Non-POSIX.
9489 Enter the next character typed literally, even if it is a special
9490 character. Non-POSIX.
9493 File: coreutils.info, Node: Special, Prev: Characters, Up: stty invocation
9495 19.2.7 Special settings
9496 -----------------------
9499 Set the minimum number of characters that will satisfy a read until
9500 the time value has expired, when `-icanon' is set.
9503 Set the number of tenths of a second before reads time out if the
9504 minimum number of characters have not been read, when `-icanon' is
9508 Set the input speed to N.
9511 Set the output speed to N.
9514 Tell the tty kernel driver that the terminal has N rows.
9519 Tell the kernel that the terminal has N columns. Non-POSIX.
9522 Print the number of rows and columns that the kernel thinks the
9523 terminal has. (Systems that don't support rows and columns in the
9524 kernel typically use the environment variables `LINES' and
9525 `COLUMNS' instead; however, GNU `stty' does not know anything
9526 about them.) Non-POSIX.
9529 Use line discipline N. Non-POSIX.
9532 Print the terminal speed.
9535 Set the input and output speeds to N. N can be one of: 0 50 75
9536 110 134 134.5 150 200 300 600 1200 1800 2400 4800 9600 19200 38400
9537 `exta' `extb'. `exta' is the same as 19200; `extb' is the same as
9538 38400. 0 hangs up the line if `-clocal' is set.
9541 File: coreutils.info, Node: printenv invocation, Next: tty invocation, Prev: stty invocation, Up: Working context
9543 19.3 `printenv': Print all or some environment variables
9544 ========================================================
9546 `printenv' prints environment variable values. Synopsis:
9548 printenv [OPTION] [VARIABLE]...
9550 If no VARIABLEs are specified, `printenv' prints the value of every
9551 environment variable. Otherwise, it prints the value of each VARIABLE
9552 that is set, and nothing for those that are not set.
9554 The only options are a lone `--help' or `--version'. *Note Common
9559 0 if all variables specified were found
9560 1 if at least one specified variable was not found
9561 2 if a write error occurred
9564 File: coreutils.info, Node: tty invocation, Prev: printenv invocation, Up: Working context
9566 19.4 `tty': Print file name of terminal on standard input
9567 =========================================================
9569 `tty' prints the file name of the terminal connected to its standard
9570 input. It prints `not a tty' if standard input is not a terminal.
9575 The program accepts the following option. Also see *Note Common
9581 Print nothing; only return an exit status.
9586 0 if standard input is a terminal
9587 1 if standard input is not a terminal
9588 2 if given incorrect arguments
9589 3 if a write error occurs
9592 File: coreutils.info, Node: User information, Next: System context, Prev: Working context, Up: Top
9597 This section describes commands that print user-related information:
9598 logins, groups, and so forth.
9602 * id invocation:: Print user identity.
9603 * logname invocation:: Print current login name.
9604 * whoami invocation:: Print effective user ID.
9605 * groups invocation:: Print group names a user is in.
9606 * users invocation:: Print login names of users currently logged in.
9607 * who invocation:: Print who is currently logged in.
9610 File: coreutils.info, Node: id invocation, Next: logname invocation, Up: User information
9612 20.1 `id': Print user identity
9613 ==============================
9615 `id' prints information about the given user, or the process running it
9616 if no user is specified. Synopsis:
9618 id [OPTION]... [USERNAME]
9620 By default, it prints the real user ID, real group ID, effective
9621 user ID if different from the real user ID, effective group ID if
9622 different from the real group ID, and supplemental group IDs.
9624 Each of these numeric values is preceded by an identifying string and
9625 followed by the corresponding user or group name in parentheses.
9627 The options cause `id' to print only part of the above information.
9628 Also see *Note Common options::.
9632 Print only the group ID.
9636 Print only the group ID and the supplementary groups.
9640 Print the user or group name instead of the ID number. Requires
9641 `-u', `-g', or `-G'.
9645 Print the real, instead of effective, user or group ID. Requires
9646 `-u', `-g', or `-G'.
9650 Print only the user ID.
9653 An exit status of zero indicates success, and a nonzero value
9657 File: coreutils.info, Node: logname invocation, Next: whoami invocation, Prev: id invocation, Up: User information
9659 20.2 `logname': Print current login name
9660 ========================================
9662 `logname' prints the calling user's name, as found in a
9663 system-maintained file (often `/var/run/utmp' or `/etc/utmp'), and
9664 exits with a status of 0. If there is no entry for the calling
9665 process, `logname' prints an error message and exits with a status of 1.
9667 The only options are `--help' and `--version'. *Note Common
9670 An exit status of zero indicates success, and a nonzero value
9674 File: coreutils.info, Node: whoami invocation, Next: groups invocation, Prev: logname invocation, Up: User information
9676 20.3 `whoami': Print effective user ID
9677 ======================================
9679 `whoami' prints the user name associated with the current effective
9680 user ID. It is equivalent to the command `id -un'.
9682 The only options are `--help' and `--version'. *Note Common
9685 An exit status of zero indicates success, and a nonzero value
9689 File: coreutils.info, Node: groups invocation, Next: users invocation, Prev: whoami invocation, Up: User information
9691 20.4 `groups': Print group names a user is in
9692 =============================================
9694 `groups' prints the names of the primary and any supplementary groups
9695 for each given USERNAME, or the current process if no names are given.
9696 If more than one name is given, the name of each user is printed before
9697 the list of that user's groups. Synopsis:
9699 groups [USERNAME]...
9701 The group lists are equivalent to the output of the command `id -Gn'.
9703 The only options are `--help' and `--version'. *Note Common
9706 An exit status of zero indicates success, and a nonzero value
9710 File: coreutils.info, Node: users invocation, Next: who invocation, Prev: groups invocation, Up: User information
9712 20.5 `users': Print login names of users currently logged in
9713 ============================================================
9715 `users' prints on a single line a blank-separated list of user names of
9716 users currently logged in to the current host. Each user name
9717 corresponds to a login session, so if a user has more than one login
9718 session, that user's name will appear the same number of times in the
9723 With no FILE argument, `users' extracts its information from a
9724 system-maintained file (often `/var/run/utmp' or `/etc/utmp'). If a
9725 file argument is given, `users' uses that file instead. A common
9726 choice is `/var/log/wtmp'.
9728 The only options are `--help' and `--version'. *Note Common
9731 An exit status of zero indicates success, and a nonzero value
9735 File: coreutils.info, Node: who invocation, Prev: users invocation, Up: User information
9737 20.6 `who': Print who is currently logged in
9738 ============================================
9740 `who' prints information about users who are currently logged on.
9743 `who' [OPTION] [FILE] [am i]
9745 If given no non-option arguments, `who' prints the following
9746 information for each user currently logged on: login name, terminal
9747 line, login time, and remote hostname or X display.
9749 If given one non-option argument, `who' uses that instead of a
9750 default system-maintained file (often `/var/run/utmp' or `/etc/utmp')
9751 as the name of the file containing the record of users logged on.
9752 `/var/log/wtmp' is commonly given as an argument to `who' to look at
9753 who has previously logged on.
9755 If given two non-option arguments, `who' prints only the entry for
9756 the user running it (determined from its standard input), preceded by
9757 the hostname. Traditionally, the two arguments given are `am i', as in
9760 Time stamps are listed according to the time zone rules specified by
9761 the `TZ' environment variable, or by the system default rules if `TZ'
9762 is not set. *Note Specifying the Time Zone with `TZ': (libc)TZ
9765 The program accepts the following options. Also see *Note Common
9770 Same as `-b -d --login -p -r -t -T -u'.
9774 Print the date and time of last system boot.
9778 Print information corresponding to dead processes.
9782 Print column headings.
9789 Print only the login names and the number of users logged on.
9790 Overrides all other options.
9793 Ignored; for compatibility with other versions of `who'.
9796 After the login time, print the number of hours and minutes that
9797 the user has been idle. `.' means the user was active in the last
9798 minute. `old' means the user has been idle for more than 24 hours.
9802 List only the entries that correspond to processes via which the
9803 system is waiting for a user to login. The user name is always
9807 Attempt to canonicalize hostnames found in utmp through a DNS
9808 lookup. This is not the default because it can cause significant
9809 delays on systems with automatic dial-up internet access.
9813 Print a line of column headings.
9820 After each login name print a character indicating the user's
9823 `+' allowing `write' messages
9824 `-' disallowing `write' messages
9825 `?' cannot find terminal device
9828 An exit status of zero indicates success, and a nonzero value
9832 File: coreutils.info, Node: System context, Next: Modified command invocation, Prev: User information, Up: Top
9837 This section describes commands that print or change system-wide
9842 * date invocation:: Print or set system date and time.
9843 * uname invocation:: Print system information.
9844 * hostname invocation:: Print or set system name.
9845 * hostid invocation:: Print numeric host identifier.
9848 File: coreutils.info, Node: date invocation, Next: uname invocation, Up: System context
9850 21.1 `date': Print or set system date and time
9851 ==============================================
9855 date [OPTION]... [+FORMAT]
9856 date [-u|--utc|--universal] [ MMDDhhmm[[CC]YY][.ss] ]
9858 Invoking `date' with no FORMAT argument is equivalent to invoking it
9859 with a default format that depends on the `LC_TIME' locale category.
9860 In the default C locale, this format is `'+%a %b %e %H:%M:%S %Z %Y'',
9861 so the output looks like `Thu Mar 3 13:47:51 PST 2005'.
9863 Normally, `date' uses the time zone rules indicated by the `TZ'
9864 environment variable, or the system default rules if `TZ' is not set.
9865 *Note Specifying the Time Zone with `TZ': (libc)TZ Variable.
9867 If given an argument that starts with a `+', `date' prints the
9868 current date and time (or the date and time specified by the `--date'
9869 option, see below) in the format defined by that argument, which is
9870 similar to that of the `strftime' function. Except for conversion
9871 specifiers, which start with `%', characters in the format string are
9872 printed unchanged. The conversion specifiers are described below.
9874 An exit status of zero indicates success, and a nonzero value
9879 * Time conversion specifiers:: %[HIklMNpPrRsSTXzZ]
9880 * Date conversion specifiers:: %[aAbBcCdDeFgGhjmuUVwWxyY]
9881 * Literal conversion specifiers:: %[%nt]
9882 * Padding and other flags:: Pad with zeros, spaces, etc.
9883 * Setting the time:: Changing the system clock.
9884 * Options for date:: Instead of the current time.
9885 * Examples of date:: Examples.
9888 File: coreutils.info, Node: Time conversion specifiers, Next: Date conversion specifiers, Up: date invocation
9890 21.1.1 Time conversion specifiers
9891 ---------------------------------
9893 `date' conversion specifiers related to times.
9902 hour (` 0'...`23'). This is a GNU extension.
9905 hour (` 1'...`12'). This is a GNU extension.
9908 minute (`00'...`59')
9911 nanoseconds (`000000000'...`999999999'). This is a GNU extension.
9914 locale's equivalent of either `AM' or `PM'; blank in many locales.
9915 Noon is treated as `PM' and midnight as `AM'.
9918 like `%p', except lower case. This is a GNU extension.
9921 locale's 12-hour clock time (e.g., `11:11:04 PM')
9924 24-hour hour and minute. Same as `%H:%M'. This is a GNU
9928 seconds since the epoch, i.e., since 1970-01-01 00:00:00 UTC.
9929 Leap seconds are not counted unless leap second support is
9930 available. *Note %s-examples::, for examples. This is a GNU
9934 second (`00'...`60'). This may be `60' if leap seconds are
9938 24-hour hour, minute, and second. Same as `%H:%M:%S'.
9941 locale's time representation (e.g., `23:13:48')
9944 RFC 2822/ISO 8601 style numeric time zone (e.g., `-0600' or
9945 `+0530'), or nothing if no time zone is determinable. This value
9946 reflects the numeric time zone appropriate for the current time,
9947 using the time zone rules specified by the `TZ' environment
9948 variable. The time (and optionally, the time zone rules) can be
9949 overridden by the `--date' option. This is a GNU extension.
9952 RFC 3339/ISO 8601 style numeric time zone with `:' (e.g., `-06:00'
9953 or `+05:30'), or nothing if no time zone is determinable. This is
9957 Numeric time zone to the nearest second with `:' (e.g.,
9958 `-06:00:00' or `+05:30:00'), or nothing if no time zone is
9959 determinable. This is a GNU extension.
9962 Numeric time zone with `:' using the minimum necessary precision
9963 (e.g., `-06', `+05:30', or `-04:56:02'), or nothing if no time
9964 zone is determinable. This is a GNU extension.
9967 alphabetic time zone abbreviation (e.g., `EDT'), or nothing if no
9968 time zone is determinable. See `%z' for how it is determined.
9971 File: coreutils.info, Node: Date conversion specifiers, Next: Literal conversion specifiers, Prev: Time conversion specifiers, Up: date invocation
9973 21.1.2 Date conversion specifiers
9974 ---------------------------------
9976 `date' conversion specifiers related to dates.
9979 locale's abbreviated weekday name (e.g., `Sun')
9982 locale's full weekday name, variable length (e.g., `Sunday')
9985 locale's abbreviated month name (e.g., `Jan')
9988 locale's full month name, variable length (e.g., `January')
9991 locale's date and time (e.g., `Thu Mar 3 23:05:25 2005')
9994 century. This is like `%Y', except the last two digits are
9995 omitted. For example, it is `20' if `%Y' is `2000', and is `-0'
9996 if `%Y' is `-001'. It is normally at least two characters, but it
10000 day of month (e.g., `01')
10003 date; same as `%m/%d/%y'
10006 day of month, space padded; same as `%_d'
10009 full date in ISO 8601 format; same as `%Y-%m-%d'. This is a good
10010 choice for a date format, as it is standard and is easy to sort in
10011 the usual case where years are in the range 0000...9999. This is
10015 year corresponding to the ISO week number, but without the century
10016 (range `00' through `99'). This has the same format and value as
10017 `%y', except that if the ISO week number (see `%V') belongs to the
10018 previous or next year, that year is used instead. This is a GNU
10022 year corresponding to the ISO week number. This has the same
10023 format and value as `%Y', except that if the ISO week number (see
10024 `%V') belongs to the previous or next year, that year is used
10025 instead. It is normally useful only if `%V' is also used; for
10026 example, the format `%G-%m-%d' is probably a mistake, since it
10027 combines the ISO week number year with the conventional month and
10028 day. This is a GNU extension.
10034 day of year (`001'...`366')
10037 month (`01'...`12')
10040 day of week (`1'...`7') with `1' corresponding to Monday
10043 week number of year, with Sunday as the first day of the week
10044 (`00'...`53'). Days in a new year preceding the first Sunday are
10048 ISO week number, that is, the week number of year, with Monday as
10049 the first day of the week (`01'...`53'). If the week containing
10050 January 1 has four or more days in the new year, then it is
10051 considered week 1; otherwise, it is week 53 of the previous year,
10052 and the next week is week 1. (See the ISO 8601 standard.)
10055 day of week (`0'...`6') with 0 corresponding to Sunday
10058 week number of year, with Monday as first day of week
10059 (`00'...`53'). Days in a new year preceding the first Monday are
10063 locale's date representation (e.g., `12/31/99')
10066 last two digits of year (`00'...`99')
10069 year. This is normally at least four characters, but it may be
10070 more. Year `0000' precedes year `0001', and year `-001' precedes
10074 File: coreutils.info, Node: Literal conversion specifiers, Next: Padding and other flags, Prev: Date conversion specifiers, Up: date invocation
10076 21.1.3 Literal conversion specifiers
10077 ------------------------------------
10079 `date' conversion specifiers that produce literal strings.
10091 File: coreutils.info, Node: Padding and other flags, Next: Setting the time, Prev: Literal conversion specifiers, Up: date invocation
10093 21.1.4 Padding and other flags
10094 ------------------------------
10096 Unless otherwise specified, `date' normally pads numeric fields with
10097 zeros, so that, for example, numeric months are always output as two
10098 digits. Seconds since the epoch are not padded, though, since there is
10099 no natural width for them.
10101 As a GNU extension, `date' recognizes any of the following optional
10102 flags after the `%':
10105 (hyphen) Do not pad the field; useful if the output is intended for
10109 (underscore) Pad with spaces; useful if you need a fixed number of
10110 characters in the output, but zeros are too distracting.
10113 (zero) Pad with zeros even if the conversion specifier would
10114 normally pad with spaces.
10117 Use upper case characters if possible.
10120 Use opposite case characters if possible. A field that is
10121 normally upper case becomes lower case, and vice versa.
10123 Here are some examples of padding:
10125 date +%d/%m -d "Feb 1"
10127 date +%-d/%-m -d "Feb 1"
10129 date +%_d/%_m -d "Feb 1"
10132 As a GNU extension, you can specify the field width (after any flag,
10133 if present) as a decimal number. If the natural size of the output is
10134 of the field has less than the specified number of characters, the
10135 result is written right adjusted and padded to the given size. For
10136 example, `%9B' prints the right adjusted month name in a field of width
10139 An optional modifier can follow the optional flag and width
10140 specification. The modifiers are:
10143 Use the locale's alternate representation for date and time. This
10144 modifier applies to the `%c', `%C', `%x', `%X', `%y' and `%Y'
10145 conversion specifiers. In a Japanese locale, for example, `%Ex'
10146 might yield a date format based on the Japanese Emperors' reigns.
10149 Use the locale's alternate numeric symbols for numbers. This
10150 modifier applies only to numeric conversion specifiers.
10152 If the format supports the modifier but no alternate representation
10153 is available, it is ignored.
10156 File: coreutils.info, Node: Setting the time, Next: Options for date, Prev: Padding and other flags, Up: date invocation
10158 21.1.5 Setting the time
10159 -----------------------
10161 If given an argument that does not start with `+', `date' sets the
10162 system clock to the date and time specified by that argument (as
10163 described below). You must have appropriate privileges to set the
10164 system clock. The `--date' and `--set' options may not be used with
10165 such an argument. The `--universal' option may be used with such an
10166 argument to indicate that the specified date and time are relative to
10167 Coordinated Universal Time rather than to the local time zone.
10169 The argument must consist entirely of digits, which have the
10185 first two digits of year (optional)
10188 last two digits of year (optional)
10193 The `--set' option also sets the system clock; see the next section.
10196 File: coreutils.info, Node: Options for date, Next: Examples of date, Prev: Setting the time, Up: date invocation
10198 21.1.6 Options for `date'
10199 -------------------------
10201 The program accepts the following options. Also see *Note Common
10206 Display the date and time specified in DATESTR instead of the
10207 current date and time. DATESTR can be in almost any common
10208 format. It can contain month names, time zones, `am' and `pm',
10209 `yesterday', etc. For example, `--date="2004-02-27
10210 14:19:13.489392193 +0530"' specifies the instant of time that is
10211 489,392,193 nanoseconds after February 27, 2004 at 2:19:13 PM in a
10212 time zone that is 5 hours and 30 minutes east of UTC. *Note Date
10217 Parse each line in DATEFILE as with `-d' and display the resulting
10218 date and time. If DATEFILE is `-', use standard input. This is
10219 useful when you have many dates to process, because the system
10220 overhead of starting up the `date' executable many times can be
10225 Display the date and time of the last modification of FILE,
10226 instead of the current date and time.
10231 Display the date and time using the format `%a, %d %b %Y %H:%M:%S
10232 %z', evaluated in the C locale so abbreviations are always in
10233 English. For example:
10235 Fri, 09 Sep 2005 13:51:39 -0700
10237 This format conforms to Internet RFCs 2822
10238 (ftp://ftp.rfc-editor.org/in-notes/rfc2822.txt) and 822
10239 (ftp://ftp.rfc-editor.org/in-notes/rfc822.txt), the current and
10240 previous standards for Internet email.
10242 `--rfc-3339=TIMESPEC'
10243 Display the date using a format specified by Internet RFC 3339
10244 (ftp://ftp.rfc-editor.org/in-notes/rfc3339.txt). This is a subset
10245 of the ISO 8601 format, except that it also permits applications
10246 to use a space rather than a `T' to separate dates from times.
10247 Unlike the other standard formats, RFC 3339 format is always
10248 suitable as input for the `--date' (`-d') and `--file' (`-f')
10249 options, regardless of the current locale.
10251 The argument TIMESPEC specifies how much of the time to include.
10252 It can be one of the following:
10255 Print just the full-date, e.g., `2005-09-14'. This is
10256 equivalent to the format `%Y-%m-%d'.
10259 Print the full-date and full-time separated by a space, e.g.,
10260 `2005-09-14 00:56:06+05:30'. The output ends with a numeric
10261 time-offset; here the `+05:30' means that local time is five
10262 hours and thirty minutes east of UTC. This is equivalent to
10263 the format `%Y-%m-%d %H:%M:%S%:z'.
10266 Like `seconds', but also print nanoseconds, e.g., `2005-09-14
10267 00:56:06.998458565+05:30'. This is equivalent to the format
10268 `%Y-%m-%d %H:%M:%S.%N%:z'.
10273 Set the date and time to DATESTR. See `-d' above.
10278 Use Coordinated Universal Time (UTC) by operating as if the `TZ'
10279 environment variable were set to the string `UTC0'. Coordinated
10280 Universal Time is often called "Greenwich Mean Time" (GMT) for
10281 historical reasons.
10284 File: coreutils.info, Node: Examples of date, Prev: Options for date, Up: date invocation
10286 21.1.7 Examples of `date'
10287 -------------------------
10289 Here are a few examples. Also see the documentation for the `-d'
10290 option in the previous section.
10292 * To print the date of the day before yesterday:
10294 date --date='2 days ago'
10296 * To print the date of the day three months and one day hence:
10298 date --date='3 months 1 day'
10300 * To print the day of year of Christmas in the current year:
10302 date --date='25 Dec' +%j
10304 * To print the current full month name and the day of the month:
10308 But this may not be what you want because for the first nine days
10309 of the month, the `%d' expands to a zero-padded two-digit field,
10310 for example `date -d 1may '+%B %d'' will print `May 01'.
10312 * To print a date without the leading zero for one-digit days of the
10313 month, you can use the (GNU extension) `-' flag to suppress the
10314 padding altogether:
10316 date -d 1may '+%B %-d
10318 * To print the current date and time in the format required by many
10319 non-GNU versions of `date' when setting the system clock:
10321 date +%m%d%H%M%Y.%S
10323 * To set the system clock forward by two minutes:
10325 date --set='+2 minutes'
10327 * To print the date in RFC 2822 format, use `date --rfc-2822'. Here
10328 is some example output:
10330 Fri, 09 Sep 2005 13:51:39 -0700
10332 * To convert a date string to the number of seconds since the epoch
10333 (which is 1970-01-01 00:00:00 UTC), use the `--date' option with
10334 the `%s' format. That can be useful in sorting and/or graphing
10335 and/or comparing data by date. The following command outputs the
10336 number of the seconds since the epoch for the time two minutes
10339 date --date='1970-01-01 00:02:00 +0000' +%s
10342 If you do not specify time zone information in the date string,
10343 `date' uses your computer's idea of the time zone when
10344 interpreting the string. For example, if your computer's time
10345 zone is that of Cambridge, Massachusetts, which was then 5 hours
10346 (i.e., 18,000 seconds) behind UTC:
10348 # local time zone used
10349 date --date='1970-01-01 00:02:00' +%s
10352 * If you're sorting or graphing dated data, your raw date values may
10353 be represented as seconds since the epoch. But few people can
10354 look at the date `946684800' and casually note "Oh, that's the
10355 first second of the year 2000 in Greenwich, England."
10357 date --date='2000-01-01 UTC' +%s
10360 An alternative is to use the `--utc' (`-u') option. Then you may
10361 omit `UTC' from the date string. Although this produces the same
10362 result for `%s' and many other format sequences, with a time zone
10363 offset different from zero, it would give a different result for
10364 zone-dependent formats like `%z'.
10366 date -u --date=2000-01-01 +%s
10369 To convert such an unwieldy number of seconds back to a more
10370 readable form, use a command like this:
10372 # local time zone used
10373 date -d '1970-01-01 UTC 946684800 seconds' +"%Y-%m-%d %T %z"
10374 1999-12-31 19:00:00 -0500
10376 Or if you do not mind depending on the `@' feature present since
10377 coreutils 5.3.0, you could shorten this to:
10379 date -d @946684800 +"%F %T %z"
10380 1999-12-31 19:00:00 -0500
10382 Often it is better to output UTC-relative date and time:
10384 date -u -d '1970-01-01 946684800 seconds' +"%Y-%m-%d %T %z"
10385 2000-01-01 00:00:00 +0000
10389 File: coreutils.info, Node: uname invocation, Next: hostname invocation, Prev: date invocation, Up: System context
10391 21.2 `uname': Print system information
10392 ======================================
10394 `uname' prints information about the machine and operating system it is
10395 run on. If no options are given, `uname' acts as if the `-s' option
10396 were given. Synopsis:
10400 If multiple options or `-a' are given, the selected information is
10401 printed in this order:
10403 KERNEL-NAME NODENAME KERNEL-RELEASE KERNEL-VERSION
10404 MACHINE PROCESSOR HARDWARE-PLATFORM OPERATING-SYSTEM
10406 The information may contain internal spaces, so such output cannot be
10407 parsed reliably. In the following example, RELEASE is
10408 `2.2.18ss.e820-bda652a #4 SMP Tue Jun 5 11:24:08 PDT 2001':
10411 => Linux dum 2.2.18 #4 SMP Tue Jun 5 11:24:08 PDT 2001 i686 unknown unknown GNU/Linux
10413 The program accepts the following options. Also see *Note Common
10418 Print all of the below information, except omit the processor type
10419 and the hardware platform name if they are unknown.
10422 `--hardware-platform'
10423 Print the hardware platform name (sometimes called the hardware
10424 implementation). Print `unknown' if the kernel does not make this
10425 information easily available, as is the case with Linux kernels.
10429 Print the machine hardware name (sometimes called the hardware
10430 class or hardware type).
10434 Print the network node hostname.
10438 Print the processor type (sometimes called the instruction set
10439 architecture or ISA). Print `unknown' if the kernel does not make
10440 this information easily available, as is the case with Linux
10444 `--operating-system'
10445 Print the name of the operating system.
10449 Print the kernel release.
10453 Print the kernel name. POSIX 1003.1-2001 (*note Standards
10454 conformance::) calls this "the implementation of the operating
10455 system", because the POSIX specification itself has no notion of
10456 "kernel". The kernel name might be the same as the operating
10457 system name printed by the `-o' or `--operating-system' option,
10458 but it might differ. Some operating systems (e.g., FreeBSD,
10459 HP-UX) have the same name as their underlying kernels; others
10460 (e.g., GNU/Linux, Solaris) do not.
10464 Print the kernel version.
10467 An exit status of zero indicates success, and a nonzero value
10471 File: coreutils.info, Node: hostname invocation, Next: hostid invocation, Prev: uname invocation, Up: System context
10473 21.3 `hostname': Print or set system name
10474 =========================================
10476 With no arguments, `hostname' prints the name of the current host
10477 system. With one argument, it sets the current host name to the
10478 specified string. You must have appropriate privileges to set the host
10483 The only options are `--help' and `--version'. *Note Common
10486 An exit status of zero indicates success, and a nonzero value
10490 File: coreutils.info, Node: hostid invocation, Prev: hostname invocation, Up: System context
10492 21.4 `hostid': Print numeric host identifier.
10493 =============================================
10495 `hostid' prints the numeric identifier of the current host in
10496 hexadecimal. This command accepts no arguments. The only options are
10497 `--help' and `--version'. *Note Common options::.
10499 For example, here's what it prints on one system I use:
10504 On that system, the 32-bit quantity happens to be closely related to
10505 the system's Internet address, but that isn't always the case.
10507 An exit status of zero indicates success, and a nonzero value
10511 File: coreutils.info, Node: Modified command invocation, Next: Process control, Prev: System context, Up: Top
10513 22 Modified command invocation
10514 ******************************
10516 This section describes commands that run other commands in some context
10517 different than the current one: a modified environment, as a different
10522 * chroot invocation:: Modify the root directory.
10523 * env invocation:: Modify environment variables.
10524 * nice invocation:: Modify niceness.
10525 * nohup invocation:: Immunize to hangups.
10526 * su invocation:: Modify user and group ID.
10529 File: coreutils.info, Node: chroot invocation, Next: env invocation, Up: Modified command invocation
10531 22.1 `chroot': Run a command with a different root directory
10532 ============================================================
10534 `chroot' runs a command with a specified root directory. On many
10535 systems, only the super-user can do this. Synopses:
10537 chroot NEWROOT [COMMAND [ARGS]...]
10540 Ordinarily, file names are looked up starting at the root of the
10541 directory structure, i.e., `/'. `chroot' changes the root to the
10542 directory NEWROOT (which must exist) and then runs COMMAND with
10543 optional ARGS. If COMMAND is not specified, the default is the value
10544 of the `SHELL' environment variable or `/bin/sh' if not set, invoked
10545 with the `-i' option. COMMAND must not be a special built-in utility
10546 (*note Special built-in utilities::).
10548 The only options are `--help' and `--version'. *Note Common
10549 options::. Options must precede operands.
10551 Here are a few tips to help avoid common problems in using chroot.
10552 To start with a simple example, make COMMAND refer to a statically
10553 linked binary. If you were to use a dynamically linked executable, then
10554 you'd have to arrange to have the shared libraries in the right place
10555 under your new root directory.
10557 For example, if you create a statically linked `ls' executable, and
10558 put it in `/tmp/empty', you can run this command as root:
10560 $ chroot /tmp/empty /ls -Rl /
10562 Then you'll see output like this:
10566 -rwxr-xr-x 1 0 0 1041745 Aug 16 11:17 ls
10568 If you want to use a dynamically linked executable, say `bash', then
10569 first run `ldd bash' to see what shared objects it needs. Then, in
10570 addition to copying the actual binary, also copy the listed files to
10571 the required positions under your intended new root directory.
10572 Finally, if the executable requires any other files (e.g., data, state,
10573 device files), copy them into place, too.
10577 1 if `chroot' itself fails
10578 126 if COMMAND is found but cannot be invoked
10579 127 if COMMAND cannot be found
10580 the exit status of COMMAND otherwise
10583 File: coreutils.info, Node: env invocation, Next: nice invocation, Prev: chroot invocation, Up: Modified command invocation
10585 22.2 `env': Run a command in a modified environment
10586 ===================================================
10588 `env' runs a command with a modified environment. Synopses:
10590 env [OPTION]... [NAME=VALUE]... [COMMAND [ARGS]...]
10593 Operands of the form `VARIABLE=VALUE' set the environment variable
10594 VARIABLE to value VALUE. VALUE may be empty (`VARIABLE='). Setting a
10595 variable to an empty value is different from unsetting it. These
10596 operands are evaluated left-to-right, so if two operands mention the
10597 same variable the earlier is ignored.
10599 Environment variable names can be empty, and can contain any
10600 characters other than `=' and the null character (ASCII NUL). However,
10601 it is wise to limit yourself to names that consist solely of
10602 underscores, digits, and ASCII letters, and that begin with a
10603 non-digit, as applications like the shell do not work well with other
10606 The first operand that does not contain the character `=' specifies
10607 the program to invoke; it is searched for according to the `PATH'
10608 environment variable. Any remaining arguments are passed as arguments
10609 to that program. The program should not be a special built-in utility
10610 (*note Special built-in utilities::).
10612 If no command name is specified following the environment
10613 specifications, the resulting environment is printed. This is like
10614 specifying the `printenv' program.
10616 The program accepts the following options. Also see *Note Common
10617 options::. Options must precede operands.
10621 Remove variable NAME from the environment, if it was in the
10626 `--ignore-environment'
10627 Start with an empty environment, ignoring the inherited
10633 0 if no COMMAND is specified and the environment is output
10634 1 if `env' itself fails
10635 126 if COMMAND is found but cannot be invoked
10636 127 if COMMAND cannot be found
10637 the exit status of COMMAND otherwise
10640 File: coreutils.info, Node: nice invocation, Next: nohup invocation, Prev: env invocation, Up: Modified command invocation
10642 22.3 `nice': Run a command with modified niceness
10643 =================================================
10645 `nice' prints or modifies a process's "niceness", a parameter that
10646 affects whether the process is scheduled favorably. Synopsis:
10648 nice [OPTION]... [COMMAND [ARG]...]
10650 If no arguments are given, `nice' prints the current niceness.
10651 Otherwise, `nice' runs the given COMMAND with its niceness adjusted.
10652 By default, its niceness is incremented by 10.
10654 Nicenesses range at least from -20 (resulting in the most favorable
10655 scheduling) through 19 (the least favorable). Some systems may have a
10656 wider range of nicenesses; conversely, other systems may enforce more
10657 restrictive limits. An attempt to set the niceness outside the
10658 supported range is treated as an attempt to use the minimum or maximum
10661 A niceness should not be confused with a scheduling priority, which
10662 lets applications determine the order in which threads are scheduled to
10663 run. Unlike a priority, a niceness is merely advice to the scheduler,
10664 which the scheduler is free to ignore. Also, as a point of
10665 terminology, POSIX defines the behavior of `nice' in terms of a "nice
10666 value", which is the nonnegative difference between a niceness and the
10667 minimum niceness. Though `nice' conforms to POSIX, its documentation
10668 and diagnostics use the term "niceness" for compatibility with
10669 historical practice.
10671 COMMAND must not be a special built-in utility (*note Special
10672 built-in utilities::).
10674 Because many shells have a built-in `nice' command, using an
10675 unadorned `nice' in a script or interactively may get you different
10676 functionality than that described here.
10678 The program accepts the following option. Also see *Note Common
10679 options::. Options must precede operands.
10682 `--adjustment=ADJUSTMENT'
10683 Add ADJUSTMENT instead of 10 to the command's niceness. If
10684 ADJUSTMENT is negative and you lack appropriate privileges, `nice'
10685 issues a warning but otherwise acts as if you specified a zero
10688 For compatibility `nice' also supports an obsolete option syntax
10689 `-ADJUSTMENT'. New scripts should use `-n ADJUSTMENT' instead.
10694 0 if no COMMAND is specified and the niceness is output
10695 1 if `nice' itself fails
10696 126 if COMMAND is found but cannot be invoked
10697 127 if COMMAND cannot be found
10698 the exit status of COMMAND otherwise
10700 It is sometimes useful to run a non-interactive program with reduced
10703 $ nice factor 4611686018427387903
10705 Since `nice' prints the current niceness, you can invoke it through
10706 itself to demonstrate how it works.
10708 The default behavior is to increase the niceness by `10':
10717 The ADJUSTMENT is relative to the current niceness. In the next
10718 example, the first `nice' invocation runs the second one with niceness
10719 10, and it in turn runs the final one with a niceness that is 3 more:
10721 $ nice nice -n 3 nice
10724 Specifying a niceness larger than the supported range is the same as
10725 specifying the maximum supported value:
10727 $ nice -n 10000000000 nice
10730 Only a privileged user may run a process with lower niceness:
10733 nice: cannot set niceness: Permission denied
10735 $ sudo nice -n -1 nice
10739 File: coreutils.info, Node: nohup invocation, Next: su invocation, Prev: nice invocation, Up: Modified command invocation
10741 22.4 `nohup': Run a command immune to hangups
10742 =============================================
10744 `nohup' runs the given COMMAND with hangup signals ignored, so that the
10745 command can continue running in the background after you log out.
10748 nohup COMMAND [ARG]...
10750 If standard input is a terminal, it is redirected from `/dev/null'
10751 so that terminal sessions do not mistakenly consider the terminal to be
10752 used by the command. This is a GNU extension; programs intended to be
10753 portable to non-GNU hosts should use `nohup COMMAND [ARG]... </dev/null'
10756 If standard output is a terminal, the command's standard output is
10757 appended to the file `nohup.out'; if that cannot be written to, it is
10758 appended to the file `$HOME/nohup.out'; and if that cannot be written
10759 to, the command is not run. Any `nohup.out' or `$HOME/nohup.out' file
10760 created by `nohup' is made readable and writable only to the user,
10761 regardless of the current umask settings.
10763 If standard error is a terminal, it is normally redirected to the
10764 same file descriptor as the (possibly-redirected) standard output.
10765 However, if standard output is closed, standard error terminal output
10766 is instead appended to the file `nohup.out' or `$HOME/nohup.out' as
10769 `nohup' does not automatically put the command it runs in the
10770 background; you must do that explicitly, by ending the command line
10771 with an `&'. Also, `nohup' does not alter the niceness of COMMAND; use
10772 `nice' for that, e.g., `nohup nice COMMAND'.
10774 COMMAND must not be a special built-in utility (*note Special
10775 built-in utilities::).
10777 The only options are `--help' and `--version'. *Note Common
10778 options::. Options must precede operands.
10782 126 if COMMAND is found but cannot be invoked
10783 127 if `nohup' itself fails or if COMMAND cannot be found
10784 the exit status of COMMAND otherwise
10787 File: coreutils.info, Node: su invocation, Prev: nohup invocation, Up: Modified command invocation
10789 22.5 `su': Run a command with substitute user and group ID
10790 ==========================================================
10792 `su' allows one user to temporarily become another user. It runs a
10793 command (often an interactive shell) with the real and effective user
10794 ID, group ID, and supplemental groups of a given USER. Synopsis:
10796 su [OPTION]... [USER [ARG]...]
10798 If no USER is given, the default is `root', the super-user. The
10799 shell to use is taken from USER's `passwd' entry, or `/bin/sh' if none
10800 is specified there. If USER has a password, `su' prompts for the
10801 password unless run by a user with effective user ID of zero (the
10804 By default, `su' does not change the current directory. It sets the
10805 environment variables `HOME' and `SHELL' from the password entry for
10806 USER, and if USER is not the super-user, sets `USER' and `LOGNAME' to
10807 USER. By default, the shell is not a login shell.
10809 Any additional ARGs are passed as additional arguments to the shell.
10811 GNU `su' does not treat `/bin/sh' or any other shells specially
10812 (e.g., by setting `argv[0]' to `-su', passing `-c' only to certain
10815 `su' can optionally be compiled to use `syslog' to report failed,
10816 and optionally successful, `su' attempts. (If the system supports
10817 `syslog'.) However, GNU `su' does not check if the user is a member of
10818 the `wheel' group; see below.
10820 The program accepts the following options. Also see *Note Common
10824 `--command=COMMAND'
10825 Pass COMMAND, a single command line to run, to the shell with a
10826 `-c' option instead of starting an interactive shell.
10830 Pass the `-f' option to the shell. This probably only makes sense
10831 if the shell run is `csh' or `tcsh', for which the `-f' option
10832 prevents reading the startup file (`.cshrc'). With Bourne-like
10833 shells, the `-f' option disables file name pattern expansion
10834 (globbing), which is not likely to be useful.
10839 Make the shell a login shell. This means the following. Unset all
10840 environment variables except `TERM', `HOME', and `SHELL' (which
10841 are set as described above), and `USER' and `LOGNAME' (which are
10842 set, even for the super-user, as described above), and set `PATH'
10843 to a compiled-in default value. Change to USER's home directory.
10844 Prepend `-' to the shell's name, intended to make it read its
10845 login startup file(s).
10849 `--preserve-environment'
10850 Do not change the environment variables `HOME', `USER', `LOGNAME',
10851 or `SHELL'. Run the shell given in the environment variable
10852 `SHELL' instead of the shell from USER's passwd entry, unless the
10853 user running `su' is not the super-user and USER's shell is
10854 restricted. A "restricted shell" is one that is not listed in the
10855 file `/etc/shells', or in a compiled-in list if that file does not
10856 exist. Parts of what this option does can be overridden by
10857 `--login' and `--shell'.
10861 Run SHELL instead of the shell from USER's passwd entry, unless
10862 the user running `su' is not the super-user and USER's shell is
10863 restricted (see `-m' just above).
10868 1 if `su' itself fails
10869 126 if subshell is found but cannot be invoked
10870 127 if subshell cannot be found
10871 the exit status of the subshell otherwise
10873 22.5.1 Why GNU `su' does not support the `wheel' group
10874 ------------------------------------------------------
10876 (This section is by Richard Stallman.)
10878 Sometimes a few of the users try to hold total power over all the
10879 rest. For example, in 1984, a few users at the MIT AI lab decided to
10880 seize power by changing the operator password on the Twenex system and
10881 keeping it secret from everyone else. (I was able to thwart this coup
10882 and give power back to the users by patching the kernel, but I wouldn't
10883 know how to do that in Unix.)
10885 However, occasionally the rulers do tell someone. Under the usual
10886 `su' mechanism, once someone learns the root password who sympathizes
10887 with the ordinary users, he or she can tell the rest. The "wheel
10888 group" feature would make this impossible, and thus cement the power of
10891 I'm on the side of the masses, not that of the rulers. If you are
10892 used to supporting the bosses and sysadmins in whatever they do, you
10893 might find this idea strange at first.
10896 File: coreutils.info, Node: Process control, Next: Delaying, Prev: Modified command invocation, Up: Top
10903 * kill invocation:: Sending a signal to processes.
10906 File: coreutils.info, Node: kill invocation, Up: Process control
10908 23.1 `kill': Send a signal to processes
10909 =======================================
10911 The `kill' command sends a signal to processes, causing them to
10912 terminate or otherwise act upon receiving the signal in some way.
10913 Alternatively, it lists information about signals. Synopses:
10915 kill [-s SIGNAL | --signal SIGNAL | -SIGNAL] PID...
10916 kill [-l | --list | -t | --table] [SIGNAL]...
10918 The first form of the `kill' command sends a signal to all PID
10919 arguments. The default signal to send if none is specified is `TERM'.
10920 The special signal number `0' does not denote a valid signal, but can
10921 be used to test whether the PID arguments specify processes to which a
10922 signal could be sent.
10924 If PID is positive, the signal is sent to the process with the
10925 process ID PID. If PID is zero, the signal is sent to all processes in
10926 the process group of the current process. If PID is -1, the signal is
10927 sent to all processes for which the user has permission to send a
10928 signal. If PID is less than -1, the signal is sent to all processes in
10929 the process group that equals the absolute value of PID.
10931 If PID is not positive, a system-dependent set of system processes
10932 is excluded from the list of processes to which the signal is sent.
10934 If a negative PID argument is desired as the first one, it should be
10935 preceded by `--'. However, as a common extension to POSIX, `--' is not
10936 required with `kill -SIGNAL -PID'. The following commands are
10944 The first form of the `kill' command succeeds if every PID argument
10945 specifies at least one process that the signal was sent to.
10947 The second form of the `kill' command lists signal information.
10948 Either the `-l' or `--list' option, or the `-t' or `--table' option
10949 must be specified. Without any SIGNAL argument, all supported signals
10950 are listed. The output of `-l' or `--list' is a list of the signal
10951 names, one per line; if SIGNAL is already a name, the signal number is
10952 printed instead. The output of `-t' or `--table' is a table of signal
10953 numbers, names, and descriptions. This form of the `kill' command
10954 succeeds if all SIGNAL arguments are valid and if there is no output
10957 The `kill' command also supports the `--help' and `--version'
10958 options. *Note Common options::.
10960 A SIGNAL may be a signal name like `HUP', or a signal number like
10961 `1', or an exit status of a process terminated by the signal. A signal
10962 name can be given in canonical form or prefixed by `SIG'. The case of
10963 the letters is ignored, except for the `-SIGNAL' option which must use
10964 upper case to avoid ambiguity with lower case option letters. The
10965 following signal names and numbers are supported on all POSIX compliant
10972 2. Terminal interrupt.
10981 9. Kill (cannot be caught or ignored).
10989 Other supported signal names have system-dependent corresponding
10990 numbers. All systems conforming to POSIX 1003.1-2001 also support the
10994 Access to an undefined portion of a memory object.
10997 Child process terminated, stopped, or continued.
11000 Continue executing, if stopped.
11003 Erroneous arithmetic operation.
11006 Illegal Instruction.
11009 Write on a pipe with no one to read it.
11012 Invalid memory reference.
11015 Stop executing (cannot be caught or ignored).
11021 Background process attempting read.
11024 Background process attempting write.
11027 High bandwidth data is available at a socket.
11030 User-defined signal 1.
11033 User-defined signal 2.
11035 POSIX 1003.1-2001 systems that support the XSI extension also support
11036 the following signals:
11042 Profiling timer expired.
11048 Trace/breakpoint trap.
11051 Virtual timer expired.
11054 CPU time limit exceeded.
11057 File size limit exceeded.
11059 POSIX 1003.1-2001 systems that support the XRT extension also support
11060 at least eight real-time signals called `RTMIN', `RTMIN+1', ...,
11061 `RTMAX-1', `RTMAX'.
11064 File: coreutils.info, Node: Delaying, Next: Numeric operations, Prev: Process control, Up: Top
11071 * sleep invocation:: Delay for a specified time.
11074 File: coreutils.info, Node: sleep invocation, Up: Delaying
11076 24.1 `sleep': Delay for a specified time
11077 ========================================
11079 `sleep' pauses for an amount of time specified by the sum of the values
11080 of the command line arguments. Synopsis:
11082 sleep NUMBER[smhd]...
11084 Each argument is a number followed by an optional unit; the default
11085 is seconds. The units are:
11099 Historical implementations of `sleep' have required that NUMBER be
11100 an integer, and only accepted a single argument without a suffix.
11101 However, GNU `sleep' accepts arbitrary floating point numbers (using a
11102 period before any fractional digits).
11104 The only options are `--help' and `--version'. *Note Common
11107 An exit status of zero indicates success, and a nonzero value
11111 File: coreutils.info, Node: Numeric operations, Next: File permissions, Prev: Delaying, Up: Top
11113 25 Numeric operations
11114 *********************
11116 These programs do numerically-related operations.
11120 * factor invocation:: Show factors of numbers.
11121 * seq invocation:: Print sequences of numbers.
11124 File: coreutils.info, Node: factor invocation, Next: seq invocation, Up: Numeric operations
11126 25.1 `factor': Print prime factors
11127 ==================================
11129 `factor' prints prime factors. Synopses:
11134 If no NUMBER is specified on the command line, `factor' reads
11135 numbers from standard input, delimited by newlines, tabs, or spaces.
11137 The only options are `--help' and `--version'. *Note Common
11140 The algorithm it uses is not very sophisticated, so for some inputs
11141 `factor' runs for a long time. The hardest numbers to factor are the
11142 products of large primes. Factoring the product of the two largest
11143 32-bit prime numbers takes about 80 seconds of CPU time on a 1.6 GHz
11146 $ p=`echo '4294967279 * 4294967291'|bc`
11148 18446743979220271189: 4294967279 4294967291
11150 Similarly, it takes about 80 seconds for GNU factor (from
11151 coreutils-5.1.2) to "factor" the largest 64-bit prime:
11153 $ factor 18446744073709551557
11154 18446744073709551557: 18446744073709551557
11156 In contrast, `factor' factors the largest 64-bit number in just over
11157 a tenth of a second:
11159 $ factor `echo '2^64-1'|bc`
11160 18446744073709551615: 3 5 17 257 641 65537 6700417
11162 An exit status of zero indicates success, and a nonzero value
11166 File: coreutils.info, Node: seq invocation, Prev: factor invocation, Up: Numeric operations
11168 25.2 `seq': Print numeric sequences
11169 ===================================
11171 `seq' prints a sequence of numbers to standard output. Synopses:
11173 seq [OPTION]... LAST
11174 seq [OPTION]... FIRST LAST
11175 seq [OPTION]... FIRST INCREMENT LAST
11177 `seq' prints the numbers from FIRST to LAST by INCREMENT. By
11178 default, each number is printed on a separate line. When INCREMENT is
11179 not specified, it defaults to `1', even when FIRST is larger than LAST.
11180 FIRST also defaults to `1'. So `seq 1' prints `1', but `seq 0' and
11181 `seq 10 5' produce no output. Floating-point numbers may be specified
11182 (using a period before any fractional digits).
11184 The program accepts the following options. Also see *Note Common
11185 options::. Options must precede operands.
11189 Print all numbers using FORMAT. FORMAT must contain exactly one
11190 of the `printf'-style floating point conversion specifications
11191 `%a', `%e', `%f', `%g', `%A', `%E', `%F', `%G'. The `%' may be
11192 followed by zero or more flags taken from the set `-+#0 '', then
11193 an optional width containing one or more digits, then an optional
11194 precision consisting of a `.' followed by zero or more digits.
11195 FORMAT may also contain any number of `%%' conversion
11196 specifications. All conversion specifications have the same
11197 meaning as with `printf'.
11199 The default format is derived from FIRST, STEP, and LAST. If
11200 these all use a fixed point decimal representation, the default
11201 format is `%.Pf', where P is the minimum precision that can
11202 represent the output numbers exactly. Otherwise, the default
11206 `--separator=STRING'
11207 Separate numbers with STRING; default is a newline. The output
11208 always terminates with a newline.
11212 Print all numbers with the same width, by padding with leading
11213 zeros. FIRST, STEP, and LAST should all use a fixed point decimal
11214 representation. (To have other kinds of padding, use `--format').
11217 You can get finer-grained control over output with `-f':
11219 $ seq -f '(%9.2E)' -9e5 1.1e6 1.3e6
11224 If you want hexadecimal integer output, you can use `printf' to
11225 perform the conversion:
11227 $ printf '%x\n' `seq 1048575 1024 1050623`
11232 For very long lists of numbers, use xargs to avoid system
11233 limitations on the length of an argument list:
11235 $ seq 1000000 | xargs printf '%x\n' | tail -n 3
11240 To generate octal output, use the printf `%o' format instead of `%x'.
11242 On most systems, seq can produce whole-number output for values up to
11243 at least `2^53'. Larger integers are approximated. The details differ
11244 depending on your floating-point implementation, but a common case is
11245 that `seq' works with integers through `2^64', and larger integers may
11246 not be numerically correct:
11248 $ seq 18446744073709551616 1 18446744073709551618
11249 18446744073709551616
11250 18446744073709551616
11251 18446744073709551618
11253 Be careful when using `seq' with a fractional INCREMENT; otherwise
11254 you may see surprising results. Most people would expect to see
11255 `0.000003' printed as the last number in this example:
11257 $ seq -s ' ' 0 0.000001 0.000003
11258 0.000000 0.000001 0.000002
11260 But that doesn't happen on many systems because `seq' is implemented
11261 using binary floating point arithmetic (via the C `long double'
11262 type)--which means decimal fractions like `0.000001' cannot be
11263 represented exactly. That in turn means some nonintuitive conditions
11264 like `0.000001 * 3 > 0.000003' will end up being true.
11266 To work around that in the above example, use a slightly larger
11267 number as the LAST value:
11269 $ seq -s ' ' 0 0.000001 0.0000031
11270 0.000000 0.000001 0.000002 0.000003
11272 In general, when using an INCREMENT with a fractional part, where
11273 (LAST - FIRST) / INCREMENT is (mathematically) a whole number, specify
11274 a slightly larger (or smaller, if INCREMENT is negative) value for LAST
11275 to ensure that LAST is the final value printed by seq.
11277 An exit status of zero indicates success, and a nonzero value
11281 File: coreutils.info, Node: File permissions, Next: Date input formats, Prev: Numeric operations, Up: Top
11283 26 File permissions
11284 *******************
11286 Each file has a set of "file mode bits" that control the kinds of
11287 access that users have to that file. They can be represented either in
11288 symbolic form or as an octal number.
11292 * Mode Structure:: Structure of file mode bits.
11293 * Symbolic Modes:: Mnemonic representation of file mode bits.
11294 * Numeric Modes:: File mode bits as octal numbers.
11295 * Directory Setuid and Setgid:: Set-user-ID and set-group-ID on directories.
11298 File: coreutils.info, Node: Mode Structure, Next: Symbolic Modes, Up: File permissions
11300 26.1 Structure of File Mode Bits
11301 ================================
11303 The file mode bits have two parts: the "file permission bits", which
11304 control ordinary access to the file, and "special mode bits", which
11305 affect only some files.
11307 There are three kinds of permissions that a user can have for a file:
11309 1. permission to read the file. For directories, this means
11310 permission to list the contents of the directory.
11312 2. permission to write to (change) the file. For directories, this
11313 means permission to create and remove files in the directory.
11315 3. permission to execute the file (run it as a program). For
11316 directories, this means permission to access files in the
11319 There are three categories of users who may have different
11320 permissions to perform any of the above operations on a file:
11322 1. the file's owner;
11324 2. other users who are in the file's group;
11328 Files are given an owner and group when they are created. Usually
11329 the owner is the current user and the group is the group of the
11330 directory the file is in, but this varies with the operating system, the
11331 file system the file is created on, and the way the file is created.
11332 You can change the owner and group of a file by using the `chown' and
11335 In addition to the three sets of three permissions listed above, the
11336 file mode bits have three special components, which affect only
11337 executable files (programs) and, on most systems, directories:
11339 1. Set the process's effective user ID to that of the file upon
11340 execution (called the "set-user-ID bit", or sometimes the "setuid
11341 bit"). For directories on a few systems, give files created in
11342 the directory the same owner as the directory, no matter who
11343 creates them, and set the set-user-ID bit of newly-created
11346 2. Set the process's effective group ID to that of the file upon
11347 execution (called the "set-group-ID bit", or sometimes the "setgid
11348 bit"). For directories on most systems, give files created in the
11349 directory the same group as the directory, no matter what group
11350 the user who creates them is in, and set the set-group-ID bit of
11351 newly-created subdirectories.
11353 3. Prevent unprivileged users from removing or renaming a file in a
11354 directory unless they own the file or the directory; this is
11355 called the "restricted deletion flag" for the directory, and is
11356 commonly found on world-writable directories like `/tmp'.
11358 For regular files on some older systems, save the program's text
11359 image on the swap device so it will load more quickly when run;
11360 this is called the "sticky bit".
11362 In addition to the file mode bits listed above, there may be file
11363 attributes specific to the file system, e.g., access control lists
11364 (ACLs), whether a file is compressed, whether a file can be modified
11365 (immutability), and whether a file can be dumped. These are usually
11366 set using programs specific to the file system. For example:
11369 On GNU and GNU/Linux the file attributes specific to the ext2 file
11370 system are set using `chattr'.
11373 On FreeBSD the file flags specific to the FFS file system are set
11376 Even if a file's mode bits allow an operation on that file, that
11377 operation may still fail, because:
11379 * the file-system-specific attributes or flags do not permit it; or
11381 * the file system is mounted as read-only.
11383 For example, if the immutable attribute is set on a file, it cannot
11384 be modified, regardless of the fact that you may have just run `chmod
11388 File: coreutils.info, Node: Symbolic Modes, Next: Numeric Modes, Prev: Mode Structure, Up: File permissions
11390 26.2 Symbolic Modes
11391 ===================
11393 "Symbolic modes" represent changes to files' mode bits as operations on
11394 single-character symbols. They allow you to modify either all or
11395 selected parts of files' mode bits, optionally based on their previous
11396 values, and perhaps on the current `umask' as well (*note Umask and
11399 The format of symbolic modes is:
11401 [ugoa...][+-=]PERMS...[,...]
11403 where PERMS is either zero or more letters from the set `rwxXst', or a
11404 single letter from the set `ugo'.
11406 The following sections describe the operators and other details of
11411 * Setting Permissions:: Basic operations on permissions.
11412 * Copying Permissions:: Copying existing permissions.
11413 * Changing Special Mode Bits:: Special mode bits.
11414 * Conditional Executability:: Conditionally affecting executability.
11415 * Multiple Changes:: Making multiple changes.
11416 * Umask and Protection:: The effect of the umask.
11419 File: coreutils.info, Node: Setting Permissions, Next: Copying Permissions, Up: Symbolic Modes
11421 26.2.1 Setting Permissions
11422 --------------------------
11424 The basic symbolic operations on a file's permissions are adding,
11425 removing, and setting the permission that certain users have to read,
11426 write, and execute or search the file. These operations have the
11429 USERS OPERATION PERMISSIONS
11431 The spaces between the three parts above are shown for readability only;
11432 symbolic modes cannot contain spaces.
11434 The USERS part tells which users' access to the file is changed. It
11435 consists of one or more of the following letters (or it can be empty;
11436 *note Umask and Protection::, for a description of what happens then).
11437 When more than one of these letters is given, the order that they are
11438 in does not matter.
11441 the user who owns the file;
11444 other users who are in the file's group;
11450 all users; the same as `ugo'.
11452 The OPERATION part tells how to change the affected users' access to
11453 the file, and is one of the following symbols:
11456 to add the PERMISSIONS to whatever permissions the USERS already
11460 to remove the PERMISSIONS from whatever permissions the USERS
11461 already have for the file;
11464 to make the PERMISSIONS the only permissions that the USERS have
11467 The PERMISSIONS part tells what kind of access to the file should be
11468 changed; it is normally zero or more of the following letters. As with
11469 the USERS part, the order does not matter when more than one letter is
11470 given. Omitting the PERMISSIONS part is useful only with the `='
11471 operation, where it gives the specified USERS no access at all to the
11475 the permission the USERS have to read the file;
11478 the permission the USERS have to write to the file;
11481 the permission the USERS have to execute the file, or search it if
11484 For example, to give everyone permission to read and write a regular
11485 file, but not to execute it, use:
11489 To remove write permission for all users other than the file's
11494 The above command does not affect the access that the owner of the file
11495 has to it, nor does it affect whether other users can read or execute
11498 To give everyone except a file's owner no permission to do anything
11499 with that file, use the mode below. Other users could still remove the
11500 file, if they have write permission on the directory it is in.
11504 Another way to specify the same thing is:
11509 File: coreutils.info, Node: Copying Permissions, Next: Changing Special Mode Bits, Prev: Setting Permissions, Up: Symbolic Modes
11511 26.2.2 Copying Existing Permissions
11512 -----------------------------------
11514 You can base a file's permissions on its existing permissions. To do
11515 this, instead of using a series of `r', `w', or `x' letters after the
11516 operator, you use the letter `u', `g', or `o'. For example, the mode
11520 adds the permissions for users who are in a file's group to the
11521 permissions that other users have for the file. Thus, if the file
11522 started out as mode 664 (`rw-rw-r--'), the above mode would change it
11523 to mode 666 (`rw-rw-rw-'). If the file had started out as mode 741
11524 (`rwxr----x'), the above mode would change it to mode 745
11525 (`rwxr--r-x'). The `-' and `=' operations work analogously.
11528 File: coreutils.info, Node: Changing Special Mode Bits, Next: Conditional Executability, Prev: Copying Permissions, Up: Symbolic Modes
11530 26.2.3 Changing Special Mode Bits
11531 ---------------------------------
11533 In addition to changing a file's read, write, and execute/search
11534 permissions, you can change its special mode bits. *Note Mode
11535 Structure::, for a summary of these special mode bits.
11537 To change the file mode bits to set the user ID on execution, use
11538 `u' in the USERS part of the symbolic mode and `s' in the PERMISSIONS
11541 To change the file mode bits to set the group ID on execution, use
11542 `g' in the USERS part of the symbolic mode and `s' in the PERMISSIONS
11545 To set both user and group ID on execution, omit the USERS part of
11546 the symbolic mode (or use `a') and use `s' in the PERMISSIONS part.
11548 To change the file mode bits to set the restricted deletion flag or
11549 sticky bit, omit the USERS part of the symbolic mode (or use `a') and
11550 use `t' in the PERMISSIONS part.
11552 For example, to set the set-user-ID mode bit of a program, you can
11557 To remove both set-user-ID and set-group-ID mode bits from it, you
11562 To set the restricted deletion flag or sticky bit, you can use the
11567 The combination `o+s' has no effect. On GNU systems the
11568 combinations `u+t' and `g+t' have no effect, and `o+t' acts like plain
11571 The `=' operator is not very useful with special mode bits. For
11576 does set the restricted deletion flag or sticky bit, but it also
11577 removes all read, write, and execute/search permissions that users not
11578 in the file's group might have had for it.
11580 *Note Directory Setuid and Setgid::, for additional rules concerning
11581 set-user-ID and set-group-ID bits and directories.
11584 File: coreutils.info, Node: Conditional Executability, Next: Multiple Changes, Prev: Changing Special Mode Bits, Up: Symbolic Modes
11586 26.2.4 Conditional Executability
11587 --------------------------------
11589 There is one more special type of symbolic permission: if you use `X'
11590 instead of `x', execute/search permission is affected only if the file
11591 is a directory or already had execute permission.
11593 For example, this mode:
11597 gives all users permission to search directories, or to execute files if
11598 anyone could execute them before.
11601 File: coreutils.info, Node: Multiple Changes, Next: Umask and Protection, Prev: Conditional Executability, Up: Symbolic Modes
11603 26.2.5 Making Multiple Changes
11604 ------------------------------
11606 The format of symbolic modes is actually more complex than described
11607 above (*note Setting Permissions::). It provides two ways to make
11608 multiple changes to files' mode bits.
11610 The first way is to specify multiple OPERATION and PERMISSIONS parts
11611 after a USERS part in the symbolic mode.
11613 For example, the mode:
11617 gives users other than the owner of the file read permission and, if it
11618 is a directory or if someone already had execute permission to it,
11619 gives them execute/search permission; and it also denies them write
11620 permission to the file. It does not affect the permission that the
11621 owner of the file has for it. The above mode is equivalent to the two
11627 The second way to make multiple changes is to specify more than one
11628 simple symbolic mode, separated by commas. For example, the mode:
11632 gives everyone permission to read the file and removes write permission
11633 on it for all users except its owner. Another example:
11637 sets all of the permission bits for the file explicitly. (It gives
11638 users who are not in the file's group no permission at all for it.)
11640 The two methods can be combined. The mode:
11644 gives all users permission to read the file, and gives users who are in
11645 the file's group permission to execute/search it as well, but not
11646 permission to write to it. The above mode could be written in several
11647 different ways; another is:
11652 File: coreutils.info, Node: Umask and Protection, Prev: Multiple Changes, Up: Symbolic Modes
11654 26.2.6 The Umask and Protection
11655 -------------------------------
11657 If the USERS part of a symbolic mode is omitted, it defaults to `a'
11658 (affect all users), except that any permissions that are _set_ in the
11659 system variable `umask' are _not affected_. The value of `umask' can
11660 be set using the `umask' command. Its default value varies from system
11663 Omitting the USERS part of a symbolic mode is generally not useful
11664 with operations other than `+'. It is useful with `+' because it
11665 allows you to use `umask' as an easily customizable protection against
11666 giving away more permission to files than you intended to.
11668 As an example, if `umask' has the value 2, which removes write
11669 permission for users who are not in the file's group, then the mode:
11673 adds permission to write to the file to its owner and to other users who
11674 are in the file's group, but _not_ to other users. In contrast, the
11679 ignores `umask', and _does_ give write permission for the file to all
11683 File: coreutils.info, Node: Numeric Modes, Next: Directory Setuid and Setgid, Prev: Symbolic Modes, Up: File permissions
11688 As an alternative to giving a symbolic mode, you can give an octal
11689 (base 8) number that represents the mode. This number is always
11690 interpreted in octal; you do not have to add a leading `0', as you do
11691 in C. Mode `0055' is the same as mode `55'.
11693 A numeric mode is usually shorter than the corresponding symbolic
11694 mode, but it is limited in that normally it cannot take into account the
11695 previous file mode bits; it can only set them absolutely. (As
11696 discussed in the next section, the set-user-ID and set-group-ID bits of
11697 directories are an exception to this general limitation.)
11699 The permissions granted to the user, to other users in the file's
11700 group, and to other users not in the file's group each require three
11701 bits, which are represented as one octal digit. The three special mode
11702 bits also require one bit each, and they are as a group represented as
11703 another octal digit. Here is how the bits are arranged, starting with
11704 the lowest valued bit:
11706 Value in Corresponding
11709 Other users not in the file's group:
11714 Other users in the file's group:
11725 1000 Restricted deletion flag or sticky bit
11726 2000 Set group ID on execution
11727 4000 Set user ID on execution
11729 For example, numeric mode `4755' corresponds to symbolic mode
11730 `u=rwxs,go=rx', and numeric mode `664' corresponds to symbolic mode
11731 `ug=rw,o=r'. Numeric mode `0' corresponds to symbolic mode `a='.
11734 File: coreutils.info, Node: Directory Setuid and Setgid, Prev: Numeric Modes, Up: File permissions
11736 26.4 Directories and the Set-User-ID and Set-Group-ID Bits
11737 ==========================================================
11739 On most systems, if a directory's set-group-ID bit is set, newly
11740 created subfiles inherit the same group as the directory, and newly
11741 created subdirectories inherit the set-group-ID bit of the parent
11742 directory. On a few systems, a directory's set-user-ID bit has a
11743 similar effect on the ownership of new subfiles and the set-user-ID
11744 bits of new subdirectories. These mechanisms let users share files
11745 more easily, by lessening the need to use `chmod' or `chown' to share
11748 These convenience mechanisms rely on the set-user-ID and set-group-ID
11749 bits of directories. If commands like `chmod' and `mkdir' routinely
11750 cleared these bits on directories, the mechanisms would be less
11751 convenient and it would be harder to share files. Therefore, a command
11752 like `chmod' does not affect the set-user-ID or set-group-ID bits of a
11753 directory unless the user specifically mentions them in a symbolic
11754 mode, or sets them in a numeric mode. For example, on systems that
11755 support set-group-ID inheritance:
11757 # These commands leave the set-user-ID and
11758 # set-group-ID bits of the subdirectories alone,
11759 # so that they retain their default values.
11763 chmod u=rwx,go=rx C
11766 mkdir -m u=rwx,go=rx F
11768 If you want to try to set these bits, you must mention them
11769 explicitly in the symbolic or numeric modes, e.g.:
11771 # These commands try to set the set-user-ID
11772 # and set-group-ID bits of the subdirectories.
11775 chmod u=rwx,go=rx,a+s H
11777 mkdir -m u=rwx,go=rx,a+s J
11779 If you want to try to clear these bits, you must mention them
11780 explicitly in a symbolic mode, e.g.:
11782 # This command tries to clear the set-user-ID
11783 # and set-group-ID bits of the directory D.
11786 This behavior is a GNU extension. Portable scripts should not rely
11787 on requests to set or clear these bits on directories, as POSIX allows
11788 implementations to ignore these requests.
11791 File: coreutils.info, Node: Date input formats, Next: Opening the software toolbox, Prev: File permissions, Up: Top
11793 27 Date input formats
11794 *********************
11798 Our units of temporal measurement, from seconds on up to months,
11799 are so complicated, asymmetrical and disjunctive so as to make
11800 coherent mental reckoning in time all but impossible. Indeed, had
11801 some tyrannical god contrived to enslave our minds to time, to
11802 make it all but impossible for us to escape subjection to sodden
11803 routines and unpleasant surprises, he could hardly have done
11804 better than handing down our present system. It is like a set of
11805 trapezoidal building blocks, with no vertical or horizontal
11806 surfaces, like a language in which the simplest thought demands
11807 ornate constructions, useless particles and lengthy
11808 circumlocutions. Unlike the more successful patterns of language
11809 and science, which enable us to face experience boldly or at least
11810 level-headedly, our system of temporal calculation silently and
11811 persistently encourages our terror of time.
11813 ... It is as though architects had to measure length in feet,
11814 width in meters and height in ells; as though basic instruction
11815 manuals demanded a knowledge of five different languages. It is
11816 no wonder then that we often look into our own immediate past or
11817 future, last Tuesday or a week from Sunday, with feelings of
11818 helpless confusion. ...
11820 -- Robert Grudin, `Time and the Art of Living'.
11822 This section describes the textual date representations that GNU
11823 programs accept. These are the strings you, as a user, can supply as
11824 arguments to the various programs. The C interface (via the `get_date'
11825 function) is not described here.
11829 * General date syntax:: Common rules.
11830 * Calendar date items:: 19 Dec 1994.
11831 * Time of day items:: 9:20pm.
11832 * Time zone items:: EST, PDT, GMT.
11833 * Day of week items:: Monday and others.
11834 * Relative items in date strings:: next tuesday, 2 years ago.
11835 * Pure numbers in date strings:: 19931219, 1440.
11836 * Seconds since the Epoch:: @1078100502.
11837 * Specifying time zone rules:: TZ="America/New_York", TZ="UTC0".
11838 * Authors of get_date:: Bellovin, Eggert, Salz, Berets, et al.
11841 File: coreutils.info, Node: General date syntax, Next: Calendar date items, Up: Date input formats
11843 27.1 General date syntax
11844 ========================
11846 A "date" is a string, possibly empty, containing many items separated
11847 by whitespace. The whitespace may be omitted when no ambiguity arises.
11848 The empty string means the beginning of today (i.e., midnight). Order
11849 of the items is immaterial. A date string may contain many flavors of
11852 * calendar date items
11854 * time of day items
11858 * day of the week items
11864 We describe each of these item types in turn, below.
11866 A few ordinal numbers may be written out in words in some contexts.
11867 This is most useful for specifying day of the week items or relative
11868 items (see below). Among the most commonly used ordinal numbers, the
11869 word `last' stands for -1, `this' stands for 0, and `first' and `next'
11870 both stand for 1. Because the word `second' stands for the unit of
11871 time there is no way to write the ordinal number 2, but for convenience
11872 `third' stands for 3, `fourth' for 4, `fifth' for 5, `sixth' for 6,
11873 `seventh' for 7, `eighth' for 8, `ninth' for 9, `tenth' for 10,
11874 `eleventh' for 11 and `twelfth' for 12.
11876 When a month is written this way, it is still considered to be
11877 written numerically, instead of being "spelled in full"; this changes
11878 the allowed strings.
11880 In the current implementation, only English is supported for words
11881 and abbreviations like `AM', `DST', `EST', `first', `January',
11882 `Sunday', `tomorrow', and `year'.
11884 The output of the `date' command is not always acceptable as a date
11885 string, not only because of the language problem, but also because
11886 there is no standard meaning for time zone items like `IST'. When using
11887 `date' to generate a date string intended to be parsed later, specify a
11888 date format that is independent of language and that does not use time
11889 zone items other than `UTC' and `Z'. Here are some ways to do this:
11891 $ LC_ALL=C TZ=UTC0 date
11892 Mon Mar 1 00:21:42 UTC 2004
11893 $ TZ=UTC0 date +'%Y-%m-%d %H:%M:%SZ'
11894 2004-03-01 00:21:42Z
11895 $ date --iso-8601=ns | tr T ' ' # --iso-8601 is a GNU extension.
11896 2004-02-29 16:21:42,692722128-0800
11897 $ date --rfc-2822 # a GNU extension
11898 Sun, 29 Feb 2004 16:21:42 -0800
11899 $ date +'%Y-%m-%d %H:%M:%S %z' # %z is a GNU extension.
11900 2004-02-29 16:21:42 -0800
11901 $ date +'@%s.%N' # %s and %N are GNU extensions.
11902 @1078100502.692722128
11904 Alphabetic case is completely ignored in dates. Comments may be
11905 introduced between round parentheses, as long as included parentheses
11906 are properly nested. Hyphens not followed by a digit are currently
11907 ignored. Leading zeros on numbers are ignored.
11909 Invalid dates like `2005-02-29' or times like `24:00' are rejected.
11910 In the typical case of a host that does not support leap seconds, a
11911 time like `23:59:60' is rejected even if it corresponds to a valid leap
11915 File: coreutils.info, Node: Calendar date items, Next: Time of day items, Prev: General date syntax, Up: Date input formats
11917 27.2 Calendar date items
11918 ========================
11920 A "calendar date item" specifies a day of the year. It is specified
11921 differently, depending on whether the month is specified numerically or
11922 literally. All these strings specify the same calendar date:
11924 1972-09-24 # ISO 8601.
11925 72-9-24 # Assume 19xx for 69 through 99,
11926 # 20xx for 00 through 68.
11927 72-09-24 # Leading zeros are ignored.
11928 9/24/72 # Common U.S. writing.
11930 24 Sept 72 # September has a special abbreviation.
11931 24 Sep 72 # Three-letter abbreviations always allowed.
11936 The year can also be omitted. In this case, the last specified year
11937 is used, or the current year if none. For example:
11942 Here are the rules.
11944 For numeric months, the ISO 8601 format `YEAR-MONTH-DAY' is allowed,
11945 where YEAR is any positive number, MONTH is a number between 01 and 12,
11946 and DAY is a number between 01 and 31. A leading zero must be present
11947 if a number is less than ten. If YEAR is 68 or smaller, then 2000 is
11948 added to it; otherwise, if YEAR is less than 100, then 1900 is added to
11949 it. The construct `MONTH/DAY/YEAR', popular in the United States, is
11950 accepted. Also `MONTH/DAY', omitting the year.
11952 Literal months may be spelled out in full: `January', `February',
11953 `March', `April', `May', `June', `July', `August', `September',
11954 `October', `November' or `December'. Literal months may be abbreviated
11955 to their first three letters, possibly followed by an abbreviating dot.
11956 It is also permitted to write `Sept' instead of `September'.
11958 When months are written literally, the calendar date may be given as
11959 any of the following:
11966 Or, omitting the year:
11971 File: coreutils.info, Node: Time of day items, Next: Time zone items, Prev: Calendar date items, Up: Date input formats
11973 27.3 Time of day items
11974 ======================
11976 A "time of day item" in date strings specifies the time on a given day.
11977 Here are some examples, all of which represent the same time:
11982 20:02-0500 # In EST (U.S. Eastern Standard Time).
11984 More generally, the time of day may be given as
11985 `HOUR:MINUTE:SECOND', where HOUR is a number between 0 and 23, MINUTE
11986 is a number between 0 and 59, and SECOND is a number between 0 and 59
11987 possibly followed by `.' or `,' and a fraction containing one or more
11988 digits. Alternatively, `:SECOND' can be omitted, in which case it is
11989 taken to be zero. On the rare hosts that support leap seconds, SECOND
11992 If the time is followed by `am' or `pm' (or `a.m.' or `p.m.'), HOUR
11993 is restricted to run from 1 to 12, and `:MINUTE' may be omitted (taken
11994 to be zero). `am' indicates the first half of the day, `pm' indicates
11995 the second half of the day. In this notation, 12 is the predecessor of
11996 1: midnight is `12am' while noon is `12pm'. (This is the zero-oriented
11997 interpretation of `12am' and `12pm', as opposed to the old tradition
11998 derived from Latin which uses `12m' for noon and `12pm' for midnight.)
12000 The time may alternatively be followed by a time zone correction,
12001 expressed as `SHHMM', where S is `+' or `-', HH is a number of zone
12002 hours and MM is a number of zone minutes. You can also separate HH
12003 from MM with a colon. When a time zone correction is given this way, it
12004 forces interpretation of the time relative to Coordinated Universal
12005 Time (UTC), overriding any previous specification for the time zone or
12006 the local time zone. For example, `+0530' and `+05:30' both stand for
12007 the time zone 5.5 hours ahead of UTC (e.g., India). The MINUTE part of
12008 the time of day may not be elided when a time zone correction is used.
12009 This is the best way to specify a time zone correction by fractional
12012 Either `am'/`pm' or a time zone correction may be specified, but not
12016 File: coreutils.info, Node: Time zone items, Next: Day of week items, Prev: Time of day items, Up: Date input formats
12018 27.4 Time zone items
12019 ====================
12021 A "time zone item" specifies an international time zone, indicated by a
12022 small set of letters, e.g., `UTC' or `Z' for Coordinated Universal
12023 Time. Any included periods are ignored. By following a
12024 non-daylight-saving time zone by the string `DST' in a separate word
12025 (that is, separated by some white space), the corresponding daylight
12026 saving time zone may be specified. Alternatively, a
12027 non-daylight-saving time zone can be followed by a time zone
12028 correction, to add the two values. This is normally done only for
12029 `UTC'; for example, `UTC+05:30' is equivalent to `+05:30'.
12031 Time zone items other than `UTC' and `Z' are obsolescent and are not
12032 recommended, because they are ambiguous; for example, `EST' has a
12033 different meaning in Australia than in the United States. Instead,
12034 it's better to use unambiguous numeric time zone corrections like
12035 `-0500', as described in the previous section.
12037 If neither a time zone item nor a time zone correction is supplied,
12038 time stamps are interpreted using the rules of the default time zone
12039 (*note Specifying time zone rules::).
12042 File: coreutils.info, Node: Day of week items, Next: Relative items in date strings, Prev: Time zone items, Up: Date input formats
12044 27.5 Day of week items
12045 ======================
12047 The explicit mention of a day of the week will forward the date (only
12048 if necessary) to reach that day of the week in the future.
12050 Days of the week may be spelled out in full: `Sunday', `Monday',
12051 `Tuesday', `Wednesday', `Thursday', `Friday' or `Saturday'. Days may
12052 be abbreviated to their first three letters, optionally followed by a
12053 period. The special abbreviations `Tues' for `Tuesday', `Wednes' for
12054 `Wednesday' and `Thur' or `Thurs' for `Thursday' are also allowed.
12056 A number may precede a day of the week item to move forward
12057 supplementary weeks. It is best used in expression like `third
12058 monday'. In this context, `last DAY' or `next DAY' is also acceptable;
12059 they move one week before or after the day that DAY by itself would
12062 A comma following a day of the week item is ignored.
12065 File: coreutils.info, Node: Relative items in date strings, Next: Pure numbers in date strings, Prev: Day of week items, Up: Date input formats
12067 27.6 Relative items in date strings
12068 ===================================
12070 "Relative items" adjust a date (or the current date if none) forward or
12071 backward. The effects of relative items accumulate. Here are some
12079 The unit of time displacement may be selected by the string `year'
12080 or `month' for moving by whole years or months. These are fuzzy units,
12081 as years and months are not all of equal duration. More precise units
12082 are `fortnight' which is worth 14 days, `week' worth 7 days, `day'
12083 worth 24 hours, `hour' worth 60 minutes, `minute' or `min' worth 60
12084 seconds, and `second' or `sec' worth one second. An `s' suffix on
12085 these units is accepted and ignored.
12087 The unit of time may be preceded by a multiplier, given as an
12088 optionally signed number. Unsigned numbers are taken as positively
12089 signed. No number at all implies 1 for a multiplier. Following a
12090 relative item by the string `ago' is equivalent to preceding the unit
12091 by a multiplier with value -1.
12093 The string `tomorrow' is worth one day in the future (equivalent to
12094 `day'), the string `yesterday' is worth one day in the past (equivalent
12097 The strings `now' or `today' are relative items corresponding to
12098 zero-valued time displacement, these strings come from the fact a
12099 zero-valued time displacement represents the current time when not
12100 otherwise changed by previous items. They may be used to stress other
12101 items, like in `12:00 today'. The string `this' also has the meaning
12102 of a zero-valued time displacement, but is preferred in date strings
12103 like `this thursday'.
12105 When a relative item causes the resulting date to cross a boundary
12106 where the clocks were adjusted, typically for daylight saving time, the
12107 resulting date and time are adjusted accordingly.
12109 The fuzz in units can cause problems with relative items. For
12110 example, `2003-07-31 -1 month' might evaluate to 2003-07-01, because
12111 2003-06-31 is an invalid date. To determine the previous month more
12112 reliably, you can ask for the month before the 15th of the current
12113 month. For example:
12116 Thu, 31 Jul 2003 13:02:39 -0700
12117 $ date --date='-1 month' +'Last month was %B?'
12118 Last month was July?
12119 $ date --date="$(date +%Y-%m-15) -1 month" +'Last month was %B!'
12120 Last month was June!
12122 Also, take care when manipulating dates around clock changes such as
12123 daylight saving leaps. In a few cases these have added or subtracted
12124 as much as 24 hours from the clock, so it is often wise to adopt
12125 universal time by setting the `TZ' environment variable to `UTC0'
12126 before embarking on calendrical calculations.
12129 File: coreutils.info, Node: Pure numbers in date strings, Next: Seconds since the Epoch, Prev: Relative items in date strings, Up: Date input formats
12131 27.7 Pure numbers in date strings
12132 =================================
12134 The precise interpretation of a pure decimal number depends on the
12135 context in the date string.
12137 If the decimal number is of the form YYYYMMDD and no other calendar
12138 date item (*note Calendar date items::) appears before it in the date
12139 string, then YYYY is read as the year, MM as the month number and DD as
12140 the day of the month, for the specified calendar date.
12142 If the decimal number is of the form HHMM and no other time of day
12143 item appears before it in the date string, then HH is read as the hour
12144 of the day and MM as the minute of the hour, for the specified time of
12145 day. MM can also be omitted.
12147 If both a calendar date and a time of day appear to the left of a
12148 number in the date string, but no relative item, then the number
12149 overrides the year.
12152 File: coreutils.info, Node: Seconds since the Epoch, Next: Specifying time zone rules, Prev: Pure numbers in date strings, Up: Date input formats
12154 27.8 Seconds since the Epoch
12155 ============================
12157 If you precede a number with `@', it represents an internal time stamp
12158 as a count of seconds. The number can contain an internal decimal
12159 point (either `.' or `,'); any excess precision not supported by the
12160 internal representation is truncated toward minus infinity. Such a
12161 number cannot be combined with any other date item, as it specifies a
12162 complete time stamp.
12164 Internally, computer times are represented as a count of seconds
12165 since an epoch--a well-defined point of time. On GNU and POSIX
12166 systems, the epoch is 1970-01-01 00:00:00 UTC, so `@0' represents this
12167 time, `@1' represents 1970-01-01 00:00:01 UTC, and so forth. GNU and
12168 most other POSIX-compliant systems support such times as an extension
12169 to POSIX, using negative counts, so that `@-1' represents 1969-12-31
12172 Traditional Unix systems count seconds with 32-bit two's-complement
12173 integers and can represent times from 1901-12-13 20:45:52 through
12174 2038-01-19 03:14:07 UTC. More modern systems use 64-bit counts of
12175 seconds with nanosecond subcounts, and can represent all the times in
12176 the known lifetime of the universe to a resolution of 1 nanosecond.
12178 On most hosts, these counts ignore the presence of leap seconds.
12179 For example, on most hosts `@915148799' represents 1998-12-31 23:59:59
12180 UTC, `@915148800' represents 1999-01-01 00:00:00 UTC, and there is no
12181 way to represent the intervening leap second 1998-12-31 23:59:60 UTC.
12184 File: coreutils.info, Node: Specifying time zone rules, Next: Authors of get_date, Prev: Seconds since the Epoch, Up: Date input formats
12186 27.9 Specifying time zone rules
12187 ===============================
12189 Normally, dates are interpreted using the rules of the current time
12190 zone, which in turn are specified by the `TZ' environment variable, or
12191 by a system default if `TZ' is not set. To specify a different set of
12192 default time zone rules that apply just to one date, start the date
12193 with a string of the form `TZ="RULE"'. The two quote characters (`"')
12194 must be present in the date, and any quotes or backslashes within RULE
12195 must be escaped by a backslash.
12197 For example, with the GNU `date' command you can answer the question
12198 "What time is it in New York when a Paris clock shows 6:30am on October
12199 31, 2004?" by using a date beginning with `TZ="Europe/Paris"' as shown
12200 in the following shell transcript:
12202 $ export TZ="America/New_York"
12203 $ date --date='TZ="Europe/Paris" 2004-10-31 06:30'
12204 Sun Oct 31 01:30:00 EDT 2004
12206 In this example, the `--date' operand begins with its own `TZ'
12207 setting, so the rest of that operand is processed according to
12208 `Europe/Paris' rules, treating the string `2004-10-31 06:30' as if it
12209 were in Paris. However, since the output of the `date' command is
12210 processed according to the overall time zone rules, it uses New York
12211 time. (Paris was normally six hours ahead of New York in 2004, but
12212 this example refers to a brief Halloween period when the gap was five
12215 A `TZ' value is a rule that typically names a location in the `tz'
12216 database (http://www.twinsun.com/tz/tz-link.htm). A recent catalog of
12217 location names appears in the TWiki Date and Time Gateway
12218 (http://twiki.org/cgi-bin/xtra/tzdate). A few non-GNU hosts require a
12219 colon before a location name in a `TZ' setting, e.g.,
12220 `TZ=":America/New_York"'.
12222 The `tz' database includes a wide variety of locations ranging from
12223 `Arctic/Longyearbyen' to `Antarctica/South_Pole', but if you are at sea
12224 and have your own private time zone, or if you are using a non-GNU host
12225 that does not support the `tz' database, you may need to use a POSIX
12226 rule instead. Simple POSIX rules like `UTC0' specify a time zone
12227 without daylight saving time; other rules can specify simple daylight
12228 saving regimes. *Note Specifying the Time Zone with `TZ': (libc)TZ
12232 File: coreutils.info, Node: Authors of get_date, Prev: Specifying time zone rules, Up: Date input formats
12234 27.10 Authors of `get_date'
12235 ===========================
12237 `get_date' was originally implemented by Steven M. Bellovin
12238 (<smb@research.att.com>) while at the University of North Carolina at
12239 Chapel Hill. The code was later tweaked by a couple of people on
12240 Usenet, then completely overhauled by Rich $alz (<rsalz@bbn.com>) and
12241 Jim Berets (<jberets@bbn.com>) in August, 1990. Various revisions for
12242 the GNU system were made by David MacKenzie, Jim Meyering, Paul Eggert
12245 This chapter was originally produced by Franc,ois Pinard
12246 (<pinard@iro.umontreal.ca>) from the `getdate.y' source code, and then
12247 edited by K. Berry (<kb@cs.umb.edu>).
12250 File: coreutils.info, Node: Opening the software toolbox, Next: Copying This Manual, Prev: Date input formats, Up: Top
12252 28 Opening the Software Toolbox
12253 *******************************
12255 An earlier version of this chapter appeared in 2 (June 1994). It was
12256 written by Arnold Robbins.
12260 * Toolbox introduction:: Toolbox introduction
12261 * I/O redirection:: I/O redirection
12262 * The who command:: The `who' command
12263 * The cut command:: The `cut' command
12264 * The sort command:: The `sort' command
12265 * The uniq command:: The `uniq' command
12266 * Putting the tools together:: Putting the tools together
12269 File: coreutils.info, Node: Toolbox introduction, Next: I/O redirection, Up: Opening the software toolbox
12271 Toolbox Introduction
12272 ====================
12274 This month's column is only peripherally related to the GNU Project, in
12275 that it describes a number of the GNU tools on your GNU/Linux system
12276 and how they might be used. What it's really about is the "Software
12277 Tools" philosophy of program development and usage.
12279 The software tools philosophy was an important and integral concept
12280 in the initial design and development of Unix (of which Linux and GNU
12281 are essentially clones). Unfortunately, in the modern day press of
12282 Internetworking and flashy GUIs, it seems to have fallen by the
12283 wayside. This is a shame, since it provides a powerful mental model
12284 for solving many kinds of problems.
12286 Many people carry a Swiss Army knife around in their pants pockets
12287 (or purse). A Swiss Army knife is a handy tool to have: it has several
12288 knife blades, a screwdriver, tweezers, toothpick, nail file, corkscrew,
12289 and perhaps a number of other things on it. For the everyday, small
12290 miscellaneous jobs where you need a simple, general purpose tool, it's
12293 On the other hand, an experienced carpenter doesn't build a house
12294 using a Swiss Army knife. Instead, he has a toolbox chock full of
12295 specialized tools--a saw, a hammer, a screwdriver, a plane, and so on.
12296 And he knows exactly when and where to use each tool; you won't catch
12297 him hammering nails with the handle of his screwdriver.
12299 The Unix developers at Bell Labs were all professional programmers
12300 and trained computer scientists. They had found that while a
12301 one-size-fits-all program might appeal to a user because there's only
12302 one program to use, in practice such programs are
12304 a. difficult to write,
12306 b. difficult to maintain and debug, and
12308 c. difficult to extend to meet new situations.
12310 Instead, they felt that programs should be specialized tools. In
12311 short, each program "should do one thing well." No more and no less.
12312 Such programs are simpler to design, write, and get right--they only do
12315 Furthermore, they found that with the right machinery for hooking
12316 programs together, that the whole was greater than the sum of the
12317 parts. By combining several special purpose programs, you could
12318 accomplish a specific task that none of the programs was designed for,
12319 and accomplish it much more quickly and easily than if you had to write
12320 a special purpose program. We will see some (classic) examples of this
12321 further on in the column. (An important additional point was that, if
12322 necessary, take a detour and build any software tools you may need
12323 first, if you don't already have something appropriate in the toolbox.)
12326 File: coreutils.info, Node: I/O redirection, Next: The who command, Prev: Toolbox introduction, Up: Opening the software toolbox
12331 Hopefully, you are familiar with the basics of I/O redirection in the
12332 shell, in particular the concepts of "standard input," "standard
12333 output," and "standard error". Briefly, "standard input" is a data
12334 source, where data comes from. A program should not need to either
12335 know or care if the data source is a disk file, a keyboard, a magnetic
12336 tape, or even a punched card reader. Similarly, "standard output" is a
12337 data sink, where data goes to. The program should neither know nor
12338 care where this might be. Programs that only read their standard
12339 input, do something to the data, and then send it on, are called
12340 "filters", by analogy to filters in a water pipeline.
12342 With the Unix shell, it's very easy to set up data pipelines:
12344 program_to_create_data | filter1 | ... | filterN > final.pretty.data
12346 We start out by creating the raw data; each filter applies some
12347 successive transformation to the data, until by the time it comes out
12348 of the pipeline, it is in the desired form.
12350 This is fine and good for standard input and standard output. Where
12351 does the standard error come in to play? Well, think about `filter1' in
12352 the pipeline above. What happens if it encounters an error in the data
12353 it sees? If it writes an error message to standard output, it will just
12354 disappear down the pipeline into `filter2''s input, and the user will
12355 probably never see it. So programs need a place where they can send
12356 error messages so that the user will notice them. This is standard
12357 error, and it is usually connected to your console or window, even if
12358 you have redirected standard output of your program away from your
12361 For filter programs to work together, the format of the data has to
12362 be agreed upon. The most straightforward and easiest format to use is
12363 simply lines of text. Unix data files are generally just streams of
12364 bytes, with lines delimited by the ASCII LF (Line Feed) character,
12365 conventionally called a "newline" in the Unix literature. (This is
12366 `'\n'' if you're a C programmer.) This is the format used by all the
12367 traditional filtering programs. (Many earlier operating systems had
12368 elaborate facilities and special purpose programs for managing binary
12369 data. Unix has always shied away from such things, under the
12370 philosophy that it's easiest to simply be able to view and edit your
12371 data with a text editor.)
12373 OK, enough introduction. Let's take a look at some of the tools,
12374 and then we'll see how to hook them together in interesting ways. In
12375 the following discussion, we will only present those command line
12376 options that interest us. As you should always do, double check your
12377 system documentation for the full story.
12380 File: coreutils.info, Node: The who command, Next: The cut command, Prev: I/O redirection, Up: Opening the software toolbox
12385 The first program is the `who' command. By itself, it generates a list
12386 of the users who are currently logged in. Although I'm writing this on
12387 a single-user system, we'll pretend that several people are logged in:
12390 -| arnold console Jan 22 19:57
12391 -| miriam ttyp0 Jan 23 14:19(:0.0)
12392 -| bill ttyp1 Jan 21 09:32(:0.0)
12393 -| arnold ttyp2 Jan 23 20:48(:0.0)
12395 Here, the `$' is the usual shell prompt, at which I typed `who'.
12396 There are three people logged in, and I am logged in twice. On
12397 traditional Unix systems, user names are never more than eight
12398 characters long. This little bit of trivia will be useful later. The
12399 output of `who' is nice, but the data is not all that exciting.
12402 File: coreutils.info, Node: The cut command, Next: The sort command, Prev: The who command, Up: Opening the software toolbox
12407 The next program we'll look at is the `cut' command. This program cuts
12408 out columns or fields of input data. For example, we can tell it to
12409 print just the login name and full name from the `/etc/passwd' file.
12410 The `/etc/passwd' file has seven fields, separated by colons:
12412 arnold:xyzzy:2076:10:Arnold D. Robbins:/home/arnold:/bin/bash
12414 To get the first and fifth fields, we would use `cut' like this:
12416 $ cut -d: -f1,5 /etc/passwd
12419 -| arnold:Arnold D. Robbins
12420 -| miriam:Miriam A. Robbins
12423 With the `-c' option, `cut' will cut out specific characters (i.e.,
12424 columns) in the input lines. This is useful for input data that has
12425 fixed width fields, and does not have a field separator. For example,
12426 list the Monday dates for the current month:
12437 File: coreutils.info, Node: The sort command, Next: The uniq command, Prev: The cut command, Up: Opening the software toolbox
12442 Next we'll look at the `sort' command. This is one of the most
12443 powerful commands on a Unix-style system; one that you will often find
12444 yourself using when setting up fancy data plumbing.
12446 The `sort' command reads and sorts each file named on the command
12447 line. It then merges the sorted data and writes it to standard output.
12448 It will read standard input if no files are given on the command line
12449 (thus making it into a filter). The sort is based on the character
12450 collating sequence or based on user-supplied ordering criteria.
12453 File: coreutils.info, Node: The uniq command, Next: Putting the tools together, Prev: The sort command, Up: Opening the software toolbox
12458 Finally (at least for now), we'll look at the `uniq' program. When
12459 sorting data, you will often end up with duplicate lines, lines that
12460 are identical. Usually, all you need is one instance of each line.
12461 This is where `uniq' comes in. The `uniq' program reads its standard
12462 input. It prints only one copy of each repeated line. It does have
12463 several options. Later on, we'll use the `-c' option, which prints
12464 each unique line, preceded by a count of the number of times that line
12465 occurred in the input.
12468 File: coreutils.info, Node: Putting the tools together, Prev: The uniq command, Up: Opening the software toolbox
12470 Putting the Tools Together
12471 ==========================
12473 Now, let's suppose this is a large ISP server system with dozens of
12474 users logged in. The management wants the system administrator to
12475 write a program that will generate a sorted list of logged in users.
12476 Furthermore, even if a user is logged in multiple times, his or her
12477 name should only show up in the output once.
12479 The administrator could sit down with the system documentation and
12480 write a C program that did this. It would take perhaps a couple of
12481 hundred lines of code and about two hours to write it, test it, and
12482 debug it. However, knowing the software toolbox, the administrator can
12483 instead start out by generating just a list of logged on users:
12491 Next, sort the list:
12493 $ who | cut -c1-8 | sort
12499 Finally, run the sorted list through `uniq', to weed out duplicates:
12501 $ who | cut -c1-8 | sort | uniq
12506 The `sort' command actually has a `-u' option that does what `uniq'
12507 does. However, `uniq' has other uses for which one cannot substitute
12510 The administrator puts this pipeline into a shell script, and makes
12511 it available for all the users on the system (`#' is the system
12512 administrator, or `root', prompt):
12514 # cat > /usr/local/bin/listusers
12515 who | cut -c1-8 | sort | uniq
12517 # chmod +x /usr/local/bin/listusers
12519 There are four major points to note here. First, with just four
12520 programs, on one command line, the administrator was able to save about
12521 two hours worth of work. Furthermore, the shell pipeline is just about
12522 as efficient as the C program would be, and it is much more efficient in
12523 terms of programmer time. People time is much more expensive than
12524 computer time, and in our modern "there's never enough time to do
12525 everything" society, saving two hours of programmer time is no mean
12528 Second, it is also important to emphasize that with the
12529 _combination_ of the tools, it is possible to do a special purpose job
12530 never imagined by the authors of the individual programs.
12532 Third, it is also valuable to build up your pipeline in stages, as
12533 we did here. This allows you to view the data at each stage in the
12534 pipeline, which helps you acquire the confidence that you are indeed
12535 using these tools correctly.
12537 Finally, by bundling the pipeline in a shell script, other users can
12538 use your command, without having to remember the fancy plumbing you set
12539 up for them. In terms of how you run them, shell scripts and compiled
12540 programs are indistinguishable.
12542 After the previous warm-up exercise, we'll look at two additional,
12543 more complicated pipelines. For them, we need to introduce two more
12546 The first is the `tr' command, which stands for "transliterate."
12547 The `tr' command works on a character-by-character basis, changing
12548 characters. Normally it is used for things like mapping upper case to
12551 $ echo ThIs ExAmPlE HaS MIXED case! | tr '[:upper:]' '[:lower:]'
12552 -| this example has mixed case!
12554 There are several options of interest:
12557 work on the complement of the listed characters, i.e., operations
12558 apply to characters not in the given set
12561 delete characters in the first set from the output
12564 squeeze repeated characters in the output into just one character.
12566 We will be using all three options in a moment.
12568 The other command we'll look at is `comm'. The `comm' command takes
12569 two sorted input files as input data, and prints out the files' lines
12570 in three columns. The output columns are the data lines unique to the
12571 first file, the data lines unique to the second file, and the data
12572 lines that are common to both. The `-1', `-2', and `-3' command line
12573 options _omit_ the respective columns. (This is non-intuitive and
12574 takes a little getting used to.) For example:
12594 The file name `-' tells `comm' to read standard input instead of a
12597 Now we're ready to build a fancy pipeline. The first application is
12598 a word frequency counter. This helps an author determine if he or she
12599 is over-using certain words.
12601 The first step is to change the case of all the letters in our input
12602 file to one case. "The" and "the" are the same word when doing
12605 $ tr '[:upper:]' '[:lower:]' < whats.gnu | ...
12607 The next step is to get rid of punctuation. Quoted words and
12608 unquoted words should be treated identically; it's easiest to just get
12609 the punctuation out of the way.
12611 $ tr '[:upper:]' '[:lower:]' < whats.gnu | tr -cd '[:alnum:]_ \n' | ...
12613 The second `tr' command operates on the complement of the listed
12614 characters, which are all the letters, the digits, the underscore, and
12615 the blank. The `\n' represents the newline character; it has to be
12616 left alone. (The ASCII tab character should also be included for good
12617 measure in a production script.)
12619 At this point, we have data consisting of words separated by blank
12620 space. The words only contain alphanumeric characters (and the
12621 underscore). The next step is break the data apart so that we have one
12622 word per line. This makes the counting operation much easier, as we
12625 $ tr '[:upper:]' '[:lower:]' < whats.gnu | tr -cd '[:alnum:]_ \n' |
12626 > tr -s ' ' '\n' | ...
12628 This command turns blanks into newlines. The `-s' option squeezes
12629 multiple newline characters in the output into just one. This helps us
12630 avoid blank lines. (The `>' is the shell's "secondary prompt." This
12631 is what the shell prints when it notices you haven't finished typing in
12634 We now have data consisting of one word per line, no punctuation,
12635 all one case. We're ready to count each word:
12637 $ tr '[:upper:]' '[:lower:]' < whats.gnu | tr -cd '[:alnum:]_ \n' |
12638 > tr -s ' ' '\n' | sort | uniq -c | ...
12640 At this point, the data might look something like this:
12651 The output is sorted by word, not by count! What we want is the most
12652 frequently used words first. Fortunately, this is easy to accomplish,
12653 with the help of two more `sort' options:
12656 do a numeric sort, not a textual one
12659 reverse the order of the sort
12661 The final pipeline looks like this:
12663 $ tr '[:upper:]' '[:lower:]' < whats.gnu | tr -cd '[:alnum:]_ \n' |
12664 > tr -s ' ' '\n' | sort | uniq -c | sort -n -r
12672 Whew! That's a lot to digest. Yet, the same principles apply.
12673 With six commands, on two lines (really one long one split for
12674 convenience), we've created a program that does something interesting
12675 and useful, in much less time than we could have written a C program to
12678 A minor modification to the above pipeline can give us a simple
12679 spelling checker! To determine if you've spelled a word correctly, all
12680 you have to do is look it up in a dictionary. If it is not there, then
12681 chances are that your spelling is incorrect. So, we need a dictionary.
12682 The conventional location for a dictionary is `/usr/dict/words'. On my
12683 GNU/Linux system,(1) this is a is a sorted, 45,402 word dictionary.
12685 Now, how to compare our file with the dictionary? As before, we
12686 generate a sorted list of words, one per line:
12688 $ tr '[:upper:]' '[:lower:]' < whats.gnu | tr -cd '[:alnum:]_ \n' |
12689 > tr -s ' ' '\n' | sort -u | ...
12691 Now, all we need is a list of words that are _not_ in the
12692 dictionary. Here is where the `comm' command comes in.
12694 $ tr '[:upper:]' '[:lower:]' < whats.gnu | tr -cd '[:alnum:]_ \n' |
12695 > tr -s ' ' '\n' | sort -u |
12696 > comm -23 - /usr/dict/words
12698 The `-2' and `-3' options eliminate lines that are only in the
12699 dictionary (the second file), and lines that are in both files. Lines
12700 only in the first file (standard input, our stream of words), are words
12701 that are not in the dictionary. These are likely candidates for
12702 spelling errors. This pipeline was the first cut at a production
12703 spelling checker on Unix.
12705 There are some other tools that deserve brief mention.
12708 search files for text that matches a regular expression
12711 count lines, words, characters
12714 a T-fitting for data pipes, copies data to files and to standard
12718 the stream editor, an advanced tool
12721 a data manipulation language, another advanced tool
12723 The software tools philosophy also espoused the following bit of
12724 advice: "Let someone else do the hard part." This means, take
12725 something that gives you most of what you need, and then massage it the
12726 rest of the way until it's in the form that you want.
12730 1. Each program should do one thing well. No more, no less.
12732 2. Combining programs with appropriate plumbing leads to results where
12733 the whole is greater than the sum of the parts. It also leads to
12734 novel uses of programs that the authors might never have imagined.
12736 3. Programs should never print extraneous header or trailer data,
12737 since these could get sent on down a pipeline. (A point we didn't
12740 4. Let someone else do the hard part.
12742 5. Know your toolbox! Use each program appropriately. If you don't
12743 have an appropriate tool, build one.
12745 As of this writing, all the programs we've discussed are available
12746 via anonymous `ftp' from:
12747 `ftp://gnudist.gnu.org/textutils/textutils-1.22.tar.gz'. (There may be
12748 more recent versions available now.)
12750 None of what I have presented in this column is new. The Software
12751 Tools philosophy was first introduced in the book `Software Tools', by
12752 Brian Kernighan and P.J. Plauger (Addison-Wesley, ISBN 0-201-03669-X).
12753 This book showed how to write and use software tools. It was written in
12754 1976, using a preprocessor for FORTRAN named `ratfor' (RATional
12755 FORtran). At the time, C was not as ubiquitous as it is now; FORTRAN
12756 was. The last chapter presented a `ratfor' to FORTRAN processor,
12757 written in `ratfor'. `ratfor' looks an awful lot like C; if you know
12758 C, you won't have any problem following the code.
12760 In 1981, the book was updated and made available as `Software Tools
12761 in Pascal' (Addison-Wesley, ISBN 0-201-10342-7). Both books are still
12762 in print and are well worth reading if you're a programmer. They
12763 certainly made a major change in how I view programming.
12765 The programs in both books are available from Brian Kernighan's home
12766 page (http://cm.bell-labs.com/who/bwk). For a number of years, there
12767 was an active Software Tools Users Group, whose members had ported the
12768 original `ratfor' programs to essentially every computer system with a
12769 FORTRAN compiler. The popularity of the group waned in the middle 1980s
12770 as Unix began to spread beyond universities.
12772 With the current proliferation of GNU code and other clones of Unix
12773 programs, these programs now receive little attention; modern C
12774 versions are much more efficient and do more than these programs do.
12775 Nevertheless, as exposition of good programming style, and evangelism
12776 for a still-valuable philosophy, these books are unparalleled, and I
12777 recommend them highly.
12779 Acknowledgment: I would like to express my gratitude to Brian
12780 Kernighan of Bell Labs, the original Software Toolsmith, for reviewing
12783 ---------- Footnotes ----------
12785 (1) Redhat Linux 6.1, for the November 2000 revision of this article.
12788 File: coreutils.info, Node: Copying This Manual, Next: Index, Prev: Opening the software toolbox, Up: Top
12790 Appendix A Copying This Manual
12791 ******************************
12795 * GNU Free Documentation License:: License for copying this manual.
12798 File: coreutils.info, Node: GNU Free Documentation License, Up: Copying This Manual
12800 A.1 GNU Free Documentation License
12801 ==================================
12803 Version 1.2, November 2002
12805 Copyright (C) 2000,2001,2002 Free Software Foundation, Inc.
12806 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
12808 Everyone is permitted to copy and distribute verbatim copies
12809 of this license document, but changing it is not allowed.
12813 The purpose of this License is to make a manual, textbook, or other
12814 functional and useful document "free" in the sense of freedom: to
12815 assure everyone the effective freedom to copy and redistribute it,
12816 with or without modifying it, either commercially or
12817 noncommercially. Secondarily, this License preserves for the
12818 author and publisher a way to get credit for their work, while not
12819 being considered responsible for modifications made by others.
12821 This License is a kind of "copyleft", which means that derivative
12822 works of the document must themselves be free in the same sense.
12823 It complements the GNU General Public License, which is a copyleft
12824 license designed for free software.
12826 We have designed this License in order to use it for manuals for
12827 free software, because free software needs free documentation: a
12828 free program should come with manuals providing the same freedoms
12829 that the software does. But this License is not limited to
12830 software manuals; it can be used for any textual work, regardless
12831 of subject matter or whether it is published as a printed book.
12832 We recommend this License principally for works whose purpose is
12833 instruction or reference.
12835 1. APPLICABILITY AND DEFINITIONS
12837 This License applies to any manual or other work, in any medium,
12838 that contains a notice placed by the copyright holder saying it
12839 can be distributed under the terms of this License. Such a notice
12840 grants a world-wide, royalty-free license, unlimited in duration,
12841 to use that work under the conditions stated herein. The
12842 "Document", below, refers to any such manual or work. Any member
12843 of the public is a licensee, and is addressed as "you". You
12844 accept the license if you copy, modify or distribute the work in a
12845 way requiring permission under copyright law.
12847 A "Modified Version" of the Document means any work containing the
12848 Document or a portion of it, either copied verbatim, or with
12849 modifications and/or translated into another language.
12851 A "Secondary Section" is a named appendix or a front-matter section
12852 of the Document that deals exclusively with the relationship of the
12853 publishers or authors of the Document to the Document's overall
12854 subject (or to related matters) and contains nothing that could
12855 fall directly within that overall subject. (Thus, if the Document
12856 is in part a textbook of mathematics, a Secondary Section may not
12857 explain any mathematics.) The relationship could be a matter of
12858 historical connection with the subject or with related matters, or
12859 of legal, commercial, philosophical, ethical or political position
12862 The "Invariant Sections" are certain Secondary Sections whose
12863 titles are designated, as being those of Invariant Sections, in
12864 the notice that says that the Document is released under this
12865 License. If a section does not fit the above definition of
12866 Secondary then it is not allowed to be designated as Invariant.
12867 The Document may contain zero Invariant Sections. If the Document
12868 does not identify any Invariant Sections then there are none.
12870 The "Cover Texts" are certain short passages of text that are
12871 listed, as Front-Cover Texts or Back-Cover Texts, in the notice
12872 that says that the Document is released under this License. A
12873 Front-Cover Text may be at most 5 words, and a Back-Cover Text may
12874 be at most 25 words.
12876 A "Transparent" copy of the Document means a machine-readable copy,
12877 represented in a format whose specification is available to the
12878 general public, that is suitable for revising the document
12879 straightforwardly with generic text editors or (for images
12880 composed of pixels) generic paint programs or (for drawings) some
12881 widely available drawing editor, and that is suitable for input to
12882 text formatters or for automatic translation to a variety of
12883 formats suitable for input to text formatters. A copy made in an
12884 otherwise Transparent file format whose markup, or absence of
12885 markup, has been arranged to thwart or discourage subsequent
12886 modification by readers is not Transparent. An image format is
12887 not Transparent if used for any substantial amount of text. A
12888 copy that is not "Transparent" is called "Opaque".
12890 Examples of suitable formats for Transparent copies include plain
12891 ASCII without markup, Texinfo input format, LaTeX input format,
12892 SGML or XML using a publicly available DTD, and
12893 standard-conforming simple HTML, PostScript or PDF designed for
12894 human modification. Examples of transparent image formats include
12895 PNG, XCF and JPG. Opaque formats include proprietary formats that
12896 can be read and edited only by proprietary word processors, SGML or
12897 XML for which the DTD and/or processing tools are not generally
12898 available, and the machine-generated HTML, PostScript or PDF
12899 produced by some word processors for output purposes only.
12901 The "Title Page" means, for a printed book, the title page itself,
12902 plus such following pages as are needed to hold, legibly, the
12903 material this License requires to appear in the title page. For
12904 works in formats which do not have any title page as such, "Title
12905 Page" means the text near the most prominent appearance of the
12906 work's title, preceding the beginning of the body of the text.
12908 A section "Entitled XYZ" means a named subunit of the Document
12909 whose title either is precisely XYZ or contains XYZ in parentheses
12910 following text that translates XYZ in another language. (Here XYZ
12911 stands for a specific section name mentioned below, such as
12912 "Acknowledgements", "Dedications", "Endorsements", or "History".)
12913 To "Preserve the Title" of such a section when you modify the
12914 Document means that it remains a section "Entitled XYZ" according
12915 to this definition.
12917 The Document may include Warranty Disclaimers next to the notice
12918 which states that this License applies to the Document. These
12919 Warranty Disclaimers are considered to be included by reference in
12920 this License, but only as regards disclaiming warranties: any other
12921 implication that these Warranty Disclaimers may have is void and
12922 has no effect on the meaning of this License.
12924 2. VERBATIM COPYING
12926 You may copy and distribute the Document in any medium, either
12927 commercially or noncommercially, provided that this License, the
12928 copyright notices, and the license notice saying this License
12929 applies to the Document are reproduced in all copies, and that you
12930 add no other conditions whatsoever to those of this License. You
12931 may not use technical measures to obstruct or control the reading
12932 or further copying of the copies you make or distribute. However,
12933 you may accept compensation in exchange for copies. If you
12934 distribute a large enough number of copies you must also follow
12935 the conditions in section 3.
12937 You may also lend copies, under the same conditions stated above,
12938 and you may publicly display copies.
12940 3. COPYING IN QUANTITY
12942 If you publish printed copies (or copies in media that commonly
12943 have printed covers) of the Document, numbering more than 100, and
12944 the Document's license notice requires Cover Texts, you must
12945 enclose the copies in covers that carry, clearly and legibly, all
12946 these Cover Texts: Front-Cover Texts on the front cover, and
12947 Back-Cover Texts on the back cover. Both covers must also clearly
12948 and legibly identify you as the publisher of these copies. The
12949 front cover must present the full title with all words of the
12950 title equally prominent and visible. You may add other material
12951 on the covers in addition. Copying with changes limited to the
12952 covers, as long as they preserve the title of the Document and
12953 satisfy these conditions, can be treated as verbatim copying in
12956 If the required texts for either cover are too voluminous to fit
12957 legibly, you should put the first ones listed (as many as fit
12958 reasonably) on the actual cover, and continue the rest onto
12961 If you publish or distribute Opaque copies of the Document
12962 numbering more than 100, you must either include a
12963 machine-readable Transparent copy along with each Opaque copy, or
12964 state in or with each Opaque copy a computer-network location from
12965 which the general network-using public has access to download
12966 using public-standard network protocols a complete Transparent
12967 copy of the Document, free of added material. If you use the
12968 latter option, you must take reasonably prudent steps, when you
12969 begin distribution of Opaque copies in quantity, to ensure that
12970 this Transparent copy will remain thus accessible at the stated
12971 location until at least one year after the last time you
12972 distribute an Opaque copy (directly or through your agents or
12973 retailers) of that edition to the public.
12975 It is requested, but not required, that you contact the authors of
12976 the Document well before redistributing any large number of
12977 copies, to give them a chance to provide you with an updated
12978 version of the Document.
12982 You may copy and distribute a Modified Version of the Document
12983 under the conditions of sections 2 and 3 above, provided that you
12984 release the Modified Version under precisely this License, with
12985 the Modified Version filling the role of the Document, thus
12986 licensing distribution and modification of the Modified Version to
12987 whoever possesses a copy of it. In addition, you must do these
12988 things in the Modified Version:
12990 A. Use in the Title Page (and on the covers, if any) a title
12991 distinct from that of the Document, and from those of
12992 previous versions (which should, if there were any, be listed
12993 in the History section of the Document). You may use the
12994 same title as a previous version if the original publisher of
12995 that version gives permission.
12997 B. List on the Title Page, as authors, one or more persons or
12998 entities responsible for authorship of the modifications in
12999 the Modified Version, together with at least five of the
13000 principal authors of the Document (all of its principal
13001 authors, if it has fewer than five), unless they release you
13002 from this requirement.
13004 C. State on the Title page the name of the publisher of the
13005 Modified Version, as the publisher.
13007 D. Preserve all the copyright notices of the Document.
13009 E. Add an appropriate copyright notice for your modifications
13010 adjacent to the other copyright notices.
13012 F. Include, immediately after the copyright notices, a license
13013 notice giving the public permission to use the Modified
13014 Version under the terms of this License, in the form shown in
13015 the Addendum below.
13017 G. Preserve in that license notice the full lists of Invariant
13018 Sections and required Cover Texts given in the Document's
13021 H. Include an unaltered copy of this License.
13023 I. Preserve the section Entitled "History", Preserve its Title,
13024 and add to it an item stating at least the title, year, new
13025 authors, and publisher of the Modified Version as given on
13026 the Title Page. If there is no section Entitled "History" in
13027 the Document, create one stating the title, year, authors,
13028 and publisher of the Document as given on its Title Page,
13029 then add an item describing the Modified Version as stated in
13030 the previous sentence.
13032 J. Preserve the network location, if any, given in the Document
13033 for public access to a Transparent copy of the Document, and
13034 likewise the network locations given in the Document for
13035 previous versions it was based on. These may be placed in
13036 the "History" section. You may omit a network location for a
13037 work that was published at least four years before the
13038 Document itself, or if the original publisher of the version
13039 it refers to gives permission.
13041 K. For any section Entitled "Acknowledgements" or "Dedications",
13042 Preserve the Title of the section, and preserve in the
13043 section all the substance and tone of each of the contributor
13044 acknowledgements and/or dedications given therein.
13046 L. Preserve all the Invariant Sections of the Document,
13047 unaltered in their text and in their titles. Section numbers
13048 or the equivalent are not considered part of the section
13051 M. Delete any section Entitled "Endorsements". Such a section
13052 may not be included in the Modified Version.
13054 N. Do not retitle any existing section to be Entitled
13055 "Endorsements" or to conflict in title with any Invariant
13058 O. Preserve any Warranty Disclaimers.
13060 If the Modified Version includes new front-matter sections or
13061 appendices that qualify as Secondary Sections and contain no
13062 material copied from the Document, you may at your option
13063 designate some or all of these sections as invariant. To do this,
13064 add their titles to the list of Invariant Sections in the Modified
13065 Version's license notice. These titles must be distinct from any
13066 other section titles.
13068 You may add a section Entitled "Endorsements", provided it contains
13069 nothing but endorsements of your Modified Version by various
13070 parties--for example, statements of peer review or that the text
13071 has been approved by an organization as the authoritative
13072 definition of a standard.
13074 You may add a passage of up to five words as a Front-Cover Text,
13075 and a passage of up to 25 words as a Back-Cover Text, to the end
13076 of the list of Cover Texts in the Modified Version. Only one
13077 passage of Front-Cover Text and one of Back-Cover Text may be
13078 added by (or through arrangements made by) any one entity. If the
13079 Document already includes a cover text for the same cover,
13080 previously added by you or by arrangement made by the same entity
13081 you are acting on behalf of, you may not add another; but you may
13082 replace the old one, on explicit permission from the previous
13083 publisher that added the old one.
13085 The author(s) and publisher(s) of the Document do not by this
13086 License give permission to use their names for publicity for or to
13087 assert or imply endorsement of any Modified Version.
13089 5. COMBINING DOCUMENTS
13091 You may combine the Document with other documents released under
13092 this License, under the terms defined in section 4 above for
13093 modified versions, provided that you include in the combination
13094 all of the Invariant Sections of all of the original documents,
13095 unmodified, and list them all as Invariant Sections of your
13096 combined work in its license notice, and that you preserve all
13097 their Warranty Disclaimers.
13099 The combined work need only contain one copy of this License, and
13100 multiple identical Invariant Sections may be replaced with a single
13101 copy. If there are multiple Invariant Sections with the same name
13102 but different contents, make the title of each such section unique
13103 by adding at the end of it, in parentheses, the name of the
13104 original author or publisher of that section if known, or else a
13105 unique number. Make the same adjustment to the section titles in
13106 the list of Invariant Sections in the license notice of the
13109 In the combination, you must combine any sections Entitled
13110 "History" in the various original documents, forming one section
13111 Entitled "History"; likewise combine any sections Entitled
13112 "Acknowledgements", and any sections Entitled "Dedications". You
13113 must delete all sections Entitled "Endorsements."
13115 6. COLLECTIONS OF DOCUMENTS
13117 You may make a collection consisting of the Document and other
13118 documents released under this License, and replace the individual
13119 copies of this License in the various documents with a single copy
13120 that is included in the collection, provided that you follow the
13121 rules of this License for verbatim copying of each of the
13122 documents in all other respects.
13124 You may extract a single document from such a collection, and
13125 distribute it individually under this License, provided you insert
13126 a copy of this License into the extracted document, and follow
13127 this License in all other respects regarding verbatim copying of
13130 7. AGGREGATION WITH INDEPENDENT WORKS
13132 A compilation of the Document or its derivatives with other
13133 separate and independent documents or works, in or on a volume of
13134 a storage or distribution medium, is called an "aggregate" if the
13135 copyright resulting from the compilation is not used to limit the
13136 legal rights of the compilation's users beyond what the individual
13137 works permit. When the Document is included in an aggregate, this
13138 License does not apply to the other works in the aggregate which
13139 are not themselves derivative works of the Document.
13141 If the Cover Text requirement of section 3 is applicable to these
13142 copies of the Document, then if the Document is less than one half
13143 of the entire aggregate, the Document's Cover Texts may be placed
13144 on covers that bracket the Document within the aggregate, or the
13145 electronic equivalent of covers if the Document is in electronic
13146 form. Otherwise they must appear on printed covers that bracket
13147 the whole aggregate.
13151 Translation is considered a kind of modification, so you may
13152 distribute translations of the Document under the terms of section
13153 4. Replacing Invariant Sections with translations requires special
13154 permission from their copyright holders, but you may include
13155 translations of some or all Invariant Sections in addition to the
13156 original versions of these Invariant Sections. You may include a
13157 translation of this License, and all the license notices in the
13158 Document, and any Warranty Disclaimers, provided that you also
13159 include the original English version of this License and the
13160 original versions of those notices and disclaimers. In case of a
13161 disagreement between the translation and the original version of
13162 this License or a notice or disclaimer, the original version will
13165 If a section in the Document is Entitled "Acknowledgements",
13166 "Dedications", or "History", the requirement (section 4) to
13167 Preserve its Title (section 1) will typically require changing the
13172 You may not copy, modify, sublicense, or distribute the Document
13173 except as expressly provided for under this License. Any other
13174 attempt to copy, modify, sublicense or distribute the Document is
13175 void, and will automatically terminate your rights under this
13176 License. However, parties who have received copies, or rights,
13177 from you under this License will not have their licenses
13178 terminated so long as such parties remain in full compliance.
13180 10. FUTURE REVISIONS OF THIS LICENSE
13182 The Free Software Foundation may publish new, revised versions of
13183 the GNU Free Documentation License from time to time. Such new
13184 versions will be similar in spirit to the present version, but may
13185 differ in detail to address new problems or concerns. See
13186 `http://www.gnu.org/copyleft/'.
13188 Each version of the License is given a distinguishing version
13189 number. If the Document specifies that a particular numbered
13190 version of this License "or any later version" applies to it, you
13191 have the option of following the terms and conditions either of
13192 that specified version or of any later version that has been
13193 published (not as a draft) by the Free Software Foundation. If
13194 the Document does not specify a version number of this License,
13195 you may choose any version ever published (not as a draft) by the
13196 Free Software Foundation.
13198 ADDENDUM: How to use this License for your documents
13199 ====================================================
13201 To use this License in a document you have written, include a copy of
13202 the License in the document and put the following copyright and license
13203 notices just after the title page:
13205 Copyright (C) YEAR YOUR NAME.
13206 Permission is granted to copy, distribute and/or modify this document
13207 under the terms of the GNU Free Documentation License, Version 1.2
13208 or any later version published by the Free Software Foundation;
13209 with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
13210 Texts. A copy of the license is included in the section entitled ``GNU
13211 Free Documentation License''.
13213 If you have Invariant Sections, Front-Cover Texts and Back-Cover
13214 Texts, replace the "with...Texts." line with this:
13216 with the Invariant Sections being LIST THEIR TITLES, with
13217 the Front-Cover Texts being LIST, and with the Back-Cover Texts
13220 If you have Invariant Sections without Cover Texts, or some other
13221 combination of the three, merge those two alternatives to suit the
13224 If your document contains nontrivial examples of program code, we
13225 recommend releasing these examples in parallel under your choice of
13226 free software license, such as the GNU General Public License, to
13227 permit their use in free software.
13230 File: coreutils.info, Node: Index, Prev: Copying This Manual, Up: Top
13238 * !: Connectives for test.
13240 * !=: String tests. (line 25)
13241 * %: Numeric expressions. (line 15)
13242 * %b: printf invocation. (line 32)
13243 * &: Relations for expr. (line 17)
13244 * *: Numeric expressions. (line 15)
13245 * + <1>: Numeric expressions. (line 11)
13246 * +: String expressions. (line 53)
13247 * +PAGE_RANGE: pr invocation. (line 60)
13248 * - <1>: su invocation. (line 53)
13249 * - <2>: env invocation. (line 45)
13250 * -: Numeric expressions. (line 11)
13251 * - and Unix rm: rm invocation. (line 110)
13252 * -, removing files beginning with: rm invocation. (line 98)
13253 * --: Common options. (line 36)
13254 * --across: pr invocation. (line 84)
13255 * --address-radix: od invocation. (line 36)
13256 * --adjustment: nice invocation. (line 44)
13257 * --all <1>: uname invocation. (line 30)
13258 * --all <2>: who invocation. (line 36)
13259 * --all <3>: stty invocation. (line 26)
13260 * --all <4>: du invocation. (line 21)
13261 * --all <5>: df invocation. (line 32)
13262 * --all <6>: Which files are listed.
13264 * --all: unexpand invocation. (line 37)
13265 * --all-repeated: uniq invocation. (line 69)
13266 * --almost-all: Which files are listed.
13268 * --apparent-size: du invocation. (line 24)
13269 * --append: tee invocation. (line 25)
13270 * --archive: cp invocation. (line 54)
13271 * --author: What information is listed.
13273 * --backup <1>: ln invocation. (line 55)
13274 * --backup <2>: mv invocation. (line 50)
13275 * --backup <3>: install invocation. (line 40)
13276 * --backup <4>: cp invocation. (line 61)
13277 * --backup: Backup options. (line 13)
13278 * --before: tac invocation. (line 21)
13279 * --binary: md5sum invocation. (line 38)
13280 * --block-size <1>: du invocation. (line 45)
13281 * --block-size <2>: df invocation. (line 38)
13282 * --block-size: Block size. (line 138)
13283 * --block-size=SIZE: Block size. (line 12)
13284 * --body-numbering: nl invocation. (line 47)
13285 * --boot: who invocation. (line 40)
13286 * --bourne-shell: dircolors invocation.
13288 * --buffer-size: sort invocation. (line 237)
13289 * --bytes <1>: du invocation. (line 41)
13290 * --bytes <2>: cut invocation. (line 26)
13291 * --bytes <3>: wc invocation. (line 41)
13292 * --bytes <4>: split invocation. (line 37)
13293 * --bytes <5>: tail invocation. (line 36)
13294 * --bytes <6>: head invocation. (line 24)
13295 * --bytes: fold invocation. (line 23)
13296 * --c-shell: dircolors invocation.
13298 * --canonicalize: readlink invocation. (line 29)
13299 * --canonicalize-existing: readlink invocation. (line 35)
13300 * --canonicalize-missing: readlink invocation. (line 41)
13301 * --changes <1>: chmod invocation. (line 39)
13302 * --changes <2>: chgrp invocation. (line 20)
13303 * --changes: chown invocation. (line 70)
13304 * --characters: cut invocation. (line 34)
13305 * --chars: wc invocation. (line 45)
13306 * --check: sort invocation. (line 18)
13307 * --check-chars: uniq invocation. (line 103)
13308 * --classify: General output formatting.
13310 * --color: General output formatting.
13312 * --columns: pr invocation. (line 70)
13313 * --command: su invocation. (line 39)
13314 * --complement: cut invocation. (line 71)
13315 * --count <1>: who invocation. (line 55)
13316 * --count: uniq invocation. (line 55)
13317 * --count-links: du invocation. (line 91)
13318 * --crown-margin: fmt invocation. (line 34)
13319 * --csh: dircolors invocation.
13321 * --date <1>: Options for date. (line 11)
13322 * --date: touch invocation. (line 58)
13323 * --dead: who invocation. (line 44)
13324 * --decode: base64 invocation. (line 29)
13325 * --delimiter: cut invocation. (line 51)
13326 * --delimiters: paste invocation. (line 43)
13327 * --dereference <1>: stat invocation. (line 17)
13328 * --dereference <2>: du invocation. (line 96)
13329 * --dereference <3>: chgrp invocation. (line 30)
13330 * --dereference <4>: chown invocation. (line 103)
13331 * --dereference <5>: cp invocation. (line 125)
13332 * --dereference: Which files are listed.
13334 * --dereference-args: du invocation. (line 56)
13335 * --dereference-command-line: Which files are listed.
13337 * --dereference-command-line-symlink-to-dir: Which files are listed.
13339 * --dictionary-order: sort invocation. (line 85)
13340 * --digits: csplit invocation. (line 80)
13341 * --directory <1>: ln invocation. (line 61)
13342 * --directory <2>: install invocation. (line 48)
13343 * --directory: Which files are listed.
13345 * --dired: What information is listed.
13347 * --double-space: pr invocation. (line 96)
13348 * --echo: shuf invocation. (line 19)
13349 * --elide-empty-files: csplit invocation. (line 89)
13350 * --escape: Formatting the file names.
13352 * --exact: shred invocation. (line 133)
13353 * --exclude-from=FILE: du invocation. (line 201)
13354 * --exclude-type: df invocation. (line 138)
13355 * --exclude=PATTERN: du invocation. (line 195)
13356 * --expand-tabs: pr invocation. (line 120)
13357 * --fast: su invocation. (line 44)
13358 * --field-separator: sort invocation. (line 253)
13359 * --fields: cut invocation. (line 44)
13360 * --file <1>: Options for date. (line 22)
13361 * --file: stty invocation. (line 31)
13362 * --file-system: stat invocation. (line 23)
13363 * --file-type: General output formatting.
13365 * --files0-from=FILE <1>: du invocation. (line 62)
13366 * --files0-from=FILE: wc invocation. (line 60)
13367 * --first-line-number: pr invocation. (line 198)
13368 * --follow: tail invocation. (line 41)
13369 * --footer-numbering: nl invocation. (line 75)
13370 * --force <1>: ln invocation. (line 67)
13371 * --force <2>: shred invocation. (line 101)
13372 * --force <3>: rm invocation. (line 35)
13373 * --force <4>: mv invocation. (line 55)
13374 * --force: cp invocation. (line 96)
13375 * --form-feed: pr invocation. (line 128)
13376 * --format <1>: General output formatting.
13378 * --format <2>: What information is listed.
13380 * --format: od invocation. (line 76)
13381 * --format=FORMAT <1>: seq invocation. (line 24)
13382 * --format=FORMAT: stat invocation. (line 28)
13383 * --from: chown invocation. (line 80)
13384 * --full-time: What information is listed.
13386 * --general-numeric-sort: sort invocation. (line 98)
13387 * --group <1>: id invocation. (line 23)
13388 * --group: install invocation. (line 54)
13389 * --group-directories-first: Which files are listed.
13391 * --groups: id invocation. (line 27)
13392 * --hardware-platform: uname invocation. (line 35)
13393 * --head-lines: shuf invocation. (line 32)
13394 * --header: pr invocation. (line 134)
13395 * --header-numbering: nl invocation. (line 79)
13396 * --heading: who invocation. (line 48)
13397 * --help: Common options. (line 29)
13398 * --hide-control-chars: Formatting the file names.
13400 * --hide=PATTERN: Which files are listed.
13402 * --human-readable <1>: du invocation. (line 75)
13403 * --human-readable <2>: df invocation. (line 43)
13404 * --human-readable <3>: What information is listed.
13406 * --human-readable: Block size. (line 138)
13407 * --ignore-backups: Which files are listed.
13409 * --ignore-case <1>: join invocation. (line 69)
13410 * --ignore-case <2>: uniq invocation. (line 59)
13411 * --ignore-case: sort invocation. (line 92)
13412 * --ignore-environment: env invocation. (line 45)
13413 * --ignore-fail-on-non-empty: rmdir invocation. (line 17)
13414 * --ignore-garbage: base64 invocation. (line 35)
13415 * --ignore-interrupts: tee invocation. (line 30)
13416 * --ignore-leading-blanks: sort invocation. (line 79)
13417 * --ignore-nonprinting: sort invocation. (line 125)
13418 * --ignore=PATTERN: Which files are listed.
13420 * --indent: pr invocation. (line 204)
13421 * --indicator-style: General output formatting.
13423 * --initial: expand invocation. (line 34)
13424 * --inode: What information is listed.
13426 * --inodes: df invocation. (line 52)
13427 * --input-range: shuf invocation. (line 23)
13428 * --interactive <1>: ln invocation. (line 71)
13429 * --interactive <2>: rm invocation. (line 50)
13430 * --interactive <3>: mv invocation. (line 59)
13431 * --interactive: cp invocation. (line 116)
13432 * --iterations=NUMBER: shred invocation. (line 106)
13433 * --join-blank-lines: nl invocation. (line 87)
13434 * --join-lines: pr invocation. (line 147)
13435 * --keep-files: csplit invocation. (line 85)
13436 * --kernel-name: uname invocation. (line 65)
13437 * --kernel-release: uname invocation. (line 61)
13438 * --kernel-version: uname invocation. (line 76)
13439 * --key: sort invocation. (line 193)
13440 * --length: pr invocation. (line 156)
13441 * --line-bytes: split invocation. (line 43)
13442 * --lines <1>: wc invocation. (line 53)
13443 * --lines <2>: split invocation. (line 30)
13444 * --lines <3>: tail invocation. (line 130)
13445 * --lines: head invocation. (line 30)
13446 * --link: cp invocation. (line 121)
13447 * --literal: Formatting the file names.
13449 * --local: df invocation. (line 63)
13450 * --login <1>: su invocation. (line 53)
13451 * --login: who invocation. (line 68)
13452 * --lookup: who invocation. (line 73)
13453 * --machine: uname invocation. (line 41)
13454 * --max-depth=DEPTH: du invocation. (line 111)
13455 * --max-line-length: wc invocation. (line 57)
13456 * --max-unchanged-stats: tail invocation. (line 118)
13457 * --merge <1>: sort invocation. (line 32)
13458 * --merge: pr invocation. (line 164)
13459 * --mesg: who invocation. (line 86)
13460 * --message: who invocation. (line 86)
13461 * --mode <1>: mknod invocation. (line 43)
13462 * --mode <2>: mkfifo invocation. (line 21)
13463 * --mode <3>: mkdir invocation. (line 19)
13464 * --mode: install invocation. (line 60)
13465 * --month-sort: sort invocation. (line 131)
13466 * --name: id invocation. (line 31)
13467 * --no-create: touch invocation. (line 54)
13468 * --no-dereference <1>: du invocation. (line 107)
13469 * --no-dereference <2>: chgrp invocation. (line 35)
13470 * --no-dereference <3>: chown invocation. (line 108)
13471 * --no-dereference <4>: ln invocation. (line 75)
13472 * --no-dereference: cp invocation. (line 129)
13473 * --no-file-warnings: pr invocation. (line 211)
13474 * --no-group: What information is listed.
13476 * --no-newline: readlink invocation. (line 46)
13477 * --no-preserve-root <1>: chmod invocation. (line 54)
13478 * --no-preserve-root <2>: chgrp invocation. (line 48)
13479 * --no-preserve-root <3>: chown invocation. (line 121)
13480 * --no-preserve-root: rm invocation. (line 84)
13481 * --no-renumber: nl invocation. (line 108)
13482 * --no-sync: df invocation. (line 67)
13483 * --no-target-directory <1>: ln invocation. (line 109)
13484 * --no-target-directory <2>: mv invocation. (line 103)
13485 * --no-target-directory <3>: install invocation. (line 101)
13486 * --no-target-directory <4>: cp invocation. (line 272)
13487 * --no-target-directory: Target directory. (line 15)
13488 * --nodename: uname invocation. (line 46)
13489 * --null: du invocation. (line 117)
13490 * --number: cat invocation. (line 31)
13491 * --number-format: nl invocation. (line 95)
13492 * --number-lines: pr invocation. (line 177)
13493 * --number-nonblank: cat invocation. (line 20)
13494 * --number-separator: nl invocation. (line 112)
13495 * --number-width: nl invocation. (line 122)
13496 * --numeric-sort: sort invocation. (line 140)
13497 * --numeric-suffixes: split invocation. (line 51)
13498 * --numeric-uid-gid: What information is listed.
13500 * --omit-header: pr invocation. (line 235)
13501 * --omit-pagination: pr invocation. (line 246)
13502 * --one-file-system <1>: du invocation. (line 191)
13503 * --one-file-system <2>: rm invocation. (line 63)
13504 * --one-file-system: cp invocation. (line 291)
13505 * --only-delimited: cut invocation. (line 59)
13506 * --operating-system: uname invocation. (line 57)
13507 * --output <1>: shuf invocation. (line 37)
13508 * --output: sort invocation. (line 213)
13509 * --output-delimiter: cut invocation. (line 64)
13510 * --output-duplicates: od invocation. (line 146)
13511 * --output-tabs: pr invocation. (line 140)
13512 * --owner: install invocation. (line 72)
13513 * --page-increment: nl invocation. (line 83)
13514 * --page_width: pr invocation. (line 264)
13515 * --pages=PAGE_RANGE: pr invocation. (line 60)
13516 * --parents <1>: rmdir invocation. (line 22)
13517 * --parents <2>: mkdir invocation. (line 34)
13518 * --parents: cp invocation. (line 177)
13519 * --pid: tail invocation. (line 98)
13520 * --portability <1>: pathchk invocation. (line 46)
13521 * --portability: df invocation. (line 74)
13522 * --prefix: csplit invocation. (line 62)
13523 * --preserve: cp invocation. (line 134)
13524 * --preserve-environment: su invocation. (line 64)
13525 * --preserve-root <1>: chmod invocation. (line 49)
13526 * --preserve-root <2>: chgrp invocation. (line 43)
13527 * --preserve-root <3>: chown invocation. (line 116)
13528 * --preserve-root: rm invocation. (line 79)
13529 * --preserve-timestamps: install invocation. (line 78)
13530 * --print-database: dircolors invocation.
13532 * --print-type: df invocation. (line 113)
13533 * --printf=FORMAT: stat invocation. (line 37)
13534 * --processor: uname invocation. (line 50)
13535 * --quiet <1>: tty invocation. (line 18)
13536 * --quiet <2>: chmod invocation. (line 45)
13537 * --quiet <3>: chgrp invocation. (line 26)
13538 * --quiet <4>: chown invocation. (line 76)
13539 * --quiet <5>: readlink invocation. (line 52)
13540 * --quiet <6>: csplit invocation. (line 100)
13541 * --quiet <7>: tail invocation. (line 135)
13542 * --quiet: head invocation. (line 36)
13543 * --quote-name: Formatting the file names.
13545 * --quoting-style: Formatting the file names.
13547 * --random-sort: sort invocation. (line 162)
13548 * --random-source <1>: shred invocation. (line 112)
13549 * --random-source <2>: shuf invocation. (line 43)
13550 * --random-source: sort invocation. (line 226)
13551 * --read-bytes: od invocation. (line 63)
13552 * --real: id invocation. (line 36)
13553 * --recursive <1>: chmod invocation. (line 69)
13554 * --recursive <2>: chgrp invocation. (line 66)
13555 * --recursive <3>: chown invocation. (line 140)
13556 * --recursive <4>: rm invocation. (line 91)
13557 * --recursive <5>: cp invocation. (line 200)
13558 * --recursive: Which files are listed.
13560 * --reference <1>: Options for date. (line 30)
13561 * --reference <2>: touch invocation. (line 77)
13562 * --reference <3>: chmod invocation. (line 62)
13563 * --reference <4>: chgrp invocation. (line 52)
13564 * --reference: chown invocation. (line 125)
13565 * --regex: tac invocation. (line 26)
13566 * --remove: shred invocation. (line 123)
13567 * --remove-destination: cp invocation. (line 212)
13568 * --repeated: uniq invocation. (line 63)
13569 * --reply <1>: mv invocation. (line 64)
13570 * --reply: cp invocation. (line 188)
13571 * --retry: tail invocation. (line 84)
13572 * --reverse <1>: Sorting the output. (line 27)
13573 * --reverse: sort invocation. (line 157)
13574 * --rfc-2822: Options for date. (line 36)
13575 * --rfc-3339=TIMESPEC: Options for date. (line 48)
13576 * --rfc-822: Options for date. (line 36)
13577 * --save: stty invocation. (line 41)
13578 * --section-delimiter: nl invocation. (line 68)
13579 * --sep-string: pr invocation. (line 225)
13580 * --separate-dirs: du invocation. (line 134)
13581 * --separator <1>: pr invocation. (line 216)
13582 * --separator: tac invocation. (line 33)
13583 * --serial: paste invocation. (line 34)
13584 * --set: Options for date. (line 78)
13585 * --sh: dircolors invocation.
13587 * --shell: su invocation. (line 75)
13588 * --show-all: cat invocation. (line 16)
13589 * --show-control-chars <1>: Formatting the file names.
13591 * --show-control-chars: pr invocation. (line 90)
13592 * --show-ends: cat invocation. (line 27)
13593 * --show-nonprinting <1>: pr invocation. (line 251)
13594 * --show-nonprinting: cat invocation. (line 49)
13595 * --show-tabs: cat invocation. (line 42)
13596 * --si <1>: du invocation. (line 123)
13597 * --si <2>: df invocation. (line 93)
13598 * --si <3>: What information is listed.
13600 * --si: Block size. (line 138)
13601 * --silent <1>: tty invocation. (line 18)
13602 * --silent <2>: chmod invocation. (line 45)
13603 * --silent <3>: chgrp invocation. (line 26)
13604 * --silent <4>: chown invocation. (line 76)
13605 * --silent <5>: readlink invocation. (line 52)
13606 * --silent <6>: csplit invocation. (line 100)
13607 * --silent <7>: tail invocation. (line 135)
13608 * --silent: head invocation. (line 36)
13609 * --size: What information is listed.
13611 * --size=BYTES: shred invocation. (line 117)
13612 * --skip-bytes: od invocation. (line 55)
13613 * --skip-chars: uniq invocation. (line 41)
13614 * --skip-fields: uniq invocation. (line 31)
13615 * --sleep-interval: tail invocation. (line 90)
13616 * --sort: Sorting the output. (line 32)
13617 * --spaces: fold invocation. (line 29)
13618 * --sparse=WHEN: cp invocation. (line 216)
13619 * --split-only: fmt invocation. (line 47)
13620 * --squeeze-blank: cat invocation. (line 35)
13621 * --stable: sort invocation. (line 231)
13622 * --starting-line-number: nl invocation. (line 117)
13623 * --status: md5sum invocation. (line 69)
13624 * --strings: od invocation. (line 68)
13625 * --strip: install invocation. (line 88)
13626 * --strip-trailing-slashes <1>: mv invocation. (line 89)
13627 * --strip-trailing-slashes: cp invocation. (line 250)
13628 * --suffix <1>: ln invocation. (line 100)
13629 * --suffix <2>: mv invocation. (line 94)
13630 * --suffix <3>: install invocation. (line 92)
13631 * --suffix <4>: cp invocation. (line 263)
13632 * --suffix <5>: csplit invocation. (line 66)
13633 * --suffix: Backup options. (line 50)
13634 * --suffix-length: split invocation. (line 26)
13635 * --summarize: du invocation. (line 130)
13636 * --symbolic: ln invocation. (line 94)
13637 * --symbolic-link: cp invocation. (line 255)
13638 * --sync: df invocation. (line 100)
13639 * --sysv: sum invocation. (line 31)
13640 * --tabs <1>: unexpand invocation. (line 24)
13641 * --tabs: expand invocation. (line 22)
13642 * --tabsize: General output formatting.
13644 * --tagged-paragraph: fmt invocation. (line 40)
13645 * --target-directory <1>: ln invocation. (line 105)
13646 * --target-directory <2>: mv invocation. (line 99)
13647 * --target-directory <3>: install invocation. (line 97)
13648 * --target-directory <4>: cp invocation. (line 268)
13649 * --target-directory: Target directory. (line 31)
13650 * --temporary-directory: sort invocation. (line 273)
13651 * --terse: stat invocation. (line 48)
13652 * --text: md5sum invocation. (line 79)
13653 * --time <1>: du invocation. (line 138)
13654 * --time <2>: touch invocation. (line 50)
13655 * --time: Sorting the output. (line 13)
13656 * --time-style <1>: du invocation. (line 153)
13657 * --time-style: Formatting file timestamps.
13659 * --total: du invocation. (line 50)
13660 * --traditional: od invocation. (line 197)
13661 * --type: df invocation. (line 107)
13662 * --uniform-spacing: fmt invocation. (line 53)
13663 * --unique <1>: uniq invocation. (line 98)
13664 * --unique: sort invocation. (line 282)
13665 * --universal: Options for date. (line 83)
13666 * --unset: env invocation. (line 39)
13667 * --update <1>: mv invocation. (line 76)
13668 * --update: cp invocation. (line 277)
13669 * --user: id invocation. (line 41)
13670 * --utc: Options for date. (line 83)
13671 * --verbose <1>: chmod invocation. (line 59)
13672 * --verbose <2>: chgrp invocation. (line 58)
13673 * --verbose <3>: chown invocation. (line 132)
13674 * --verbose <4>: rmdir invocation. (line 31)
13675 * --verbose <5>: readlink invocation. (line 56)
13676 * --verbose <6>: mkdir invocation. (line 51)
13677 * --verbose <7>: ln invocation. (line 114)
13678 * --verbose <8>: shred invocation. (line 129)
13679 * --verbose <9>: rm invocation. (line 95)
13680 * --verbose <10>: mv invocation. (line 86)
13681 * --verbose <11>: install invocation. (line 106)
13682 * --verbose <12>: cp invocation. (line 287)
13683 * --verbose <13>: split invocation. (line 54)
13684 * --verbose <14>: tail invocation. (line 139)
13685 * --verbose: head invocation. (line 40)
13686 * --version: Common options. (line 33)
13687 * --warn: md5sum invocation. (line 88)
13688 * --width <1>: General output formatting.
13690 * --width <2>: fold invocation. (line 35)
13691 * --width <3>: pr invocation. (line 255)
13692 * --width <4>: fmt invocation. (line 59)
13693 * --width: od invocation. (line 153)
13694 * --words: wc invocation. (line 49)
13695 * --wrap: base64 invocation. (line 21)
13696 * --writable: who invocation. (line 86)
13697 * --zero: shred invocation. (line 143)
13698 * --zero-terminated <1>: shuf invocation. (line 48)
13699 * --zero-terminated: sort invocation. (line 296)
13700 * -0: du invocation. (line 116)
13701 * -1 <1>: General output formatting.
13703 * -1 <2>: join invocation. (line 74)
13704 * -1: comm invocation. (line 23)
13705 * -2 <1>: join invocation. (line 77)
13706 * -2: comm invocation. (line 23)
13707 * -3: comm invocation. (line 23)
13708 * -a <1>: uname invocation. (line 30)
13709 * -a <2>: who invocation. (line 36)
13710 * -a <3>: stty invocation. (line 26)
13711 * -a <4>: tee invocation. (line 25)
13712 * -a <5>: Connectives for test.
13714 * -a <6>: du invocation. (line 21)
13715 * -a <7>: df invocation. (line 32)
13716 * -a <8>: touch invocation. (line 50)
13717 * -a: cp invocation. (line 54)
13718 * -A: Which files are listed.
13720 * -a <1>: Which files are listed.
13722 * -a <2>: unexpand invocation. (line 37)
13723 * -a <3>: join invocation. (line 60)
13724 * -a <4>: split invocation. (line 26)
13725 * -a <5>: pr invocation. (line 84)
13726 * -a: od invocation. (line 166)
13727 * -A <1>: od invocation. (line 36)
13728 * -A: cat invocation. (line 16)
13729 * -b <1>: who invocation. (line 40)
13730 * -b: File type tests. (line 10)
13731 * -B: du invocation. (line 45)
13732 * -b: du invocation. (line 41)
13733 * -B: df invocation. (line 38)
13734 * -b <1>: ln invocation. (line 55)
13735 * -b <2>: mv invocation. (line 50)
13736 * -b <3>: install invocation. (line 40)
13737 * -b <4>: cp invocation. (line 61)
13738 * -b <5>: dircolors invocation.
13740 * -b: Formatting the file names.
13742 * -B: Which files are listed.
13744 * -b <1>: cut invocation. (line 26)
13745 * -b <2>: sort invocation. (line 79)
13746 * -b <3>: md5sum invocation. (line 38)
13747 * -b <4>: csplit invocation. (line 66)
13748 * -b <5>: split invocation. (line 37)
13749 * -b <6>: fold invocation. (line 23)
13750 * -b <7>: od invocation. (line 169)
13751 * -b <8>: nl invocation. (line 47)
13752 * -b <9>: tac invocation. (line 21)
13753 * -b <10>: cat invocation. (line 20)
13754 * -b: Backup options. (line 13)
13755 * -c <1>: su invocation. (line 39)
13756 * -c <2>: File type tests. (line 13)
13757 * -c <3>: stat invocation. (line 28)
13758 * -c <4>: du invocation. (line 50)
13759 * -c <5>: touch invocation. (line 54)
13760 * -c <6>: chmod invocation. (line 39)
13761 * -c <7>: chgrp invocation. (line 20)
13762 * -c <8>: chown invocation. (line 70)
13763 * -c <9>: install invocation. (line 44)
13764 * -c: dircolors invocation.
13766 * -C: General output formatting.
13768 * -c <1>: Sorting the output. (line 13)
13769 * -c <2>: cut invocation. (line 34)
13770 * -c <3>: uniq invocation. (line 55)
13771 * -c <4>: shuf invocation. (line 19)
13772 * -c <5>: sort invocation. (line 18)
13773 * -c: wc invocation. (line 41)
13774 * -C: split invocation. (line 43)
13775 * -c <1>: tail invocation. (line 36)
13776 * -c <2>: head invocation. (line 24)
13777 * -c <3>: pr invocation. (line 90)
13778 * -c <4>: fmt invocation. (line 34)
13779 * -c: od invocation. (line 172)
13780 * -COLUMN: pr invocation. (line 70)
13781 * -d <1>: Options for date. (line 11)
13782 * -d <2>: who invocation. (line 44)
13783 * -d: File type tests. (line 16)
13784 * -D: du invocation. (line 56)
13785 * -d <1>: touch invocation. (line 58)
13786 * -d <2>: ln invocation. (line 61)
13787 * -d <3>: install invocation. (line 48)
13788 * -d: cp invocation. (line 89)
13789 * -D: What information is listed.
13791 * -d <1>: Which files are listed.
13793 * -d <2>: paste invocation. (line 43)
13794 * -d: cut invocation. (line 51)
13795 * -D: uniq invocation. (line 69)
13796 * -d <1>: uniq invocation. (line 63)
13797 * -d <2>: sort invocation. (line 85)
13798 * -d <3>: split invocation. (line 51)
13799 * -d <4>: pr invocation. (line 96)
13800 * -d <5>: base64 invocation. (line 29)
13801 * -d <6>: od invocation. (line 176)
13802 * -d: nl invocation. (line 68)
13803 * -e: File characteristic tests.
13805 * -E: echo invocation. (line 63)
13806 * -e <1>: echo invocation. (line 20)
13807 * -e <2>: readlink invocation. (line 35)
13808 * -e <3>: join invocation. (line 64)
13809 * -e: pr invocation. (line 120)
13810 * -E: cat invocation. (line 27)
13811 * -e: cat invocation. (line 23)
13812 * -ef: File characteristic tests.
13814 * -eq: Numeric tests. (line 16)
13815 * -f <1>: su invocation. (line 44)
13816 * -f: Options for date. (line 22)
13817 * -F: stty invocation. (line 31)
13818 * -f <1>: File type tests. (line 19)
13819 * -f <2>: stat invocation. (line 23)
13820 * -f <3>: touch invocation. (line 68)
13821 * -f <4>: chmod invocation. (line 45)
13822 * -f <5>: chgrp invocation. (line 26)
13823 * -f <6>: chown invocation. (line 76)
13824 * -f <7>: readlink invocation. (line 29)
13825 * -f: ln invocation. (line 67)
13826 * -F: ln invocation. (line 61)
13827 * -f <1>: shred invocation. (line 101)
13828 * -f <2>: rm invocation. (line 35)
13829 * -f <3>: mv invocation. (line 55)
13830 * -f: cp invocation. (line 96)
13831 * -F: General output formatting.
13833 * -f <1>: Sorting the output. (line 20)
13834 * -f <2>: cut invocation. (line 44)
13835 * -f <3>: uniq invocation. (line 31)
13836 * -f <4>: sort invocation. (line 92)
13837 * -f: csplit invocation. (line 62)
13838 * -F: tail invocation. (line 79)
13839 * -f <1>: tail invocation. (line 41)
13840 * -f: pr invocation. (line 128)
13841 * -F: pr invocation. (line 128)
13842 * -f <1>: od invocation. (line 179)
13843 * -f: nl invocation. (line 75)
13844 * -f FORMAT: seq invocation. (line 24)
13845 * -G: id invocation. (line 27)
13846 * -g <1>: id invocation. (line 23)
13847 * -g: stty invocation. (line 41)
13848 * -G: Access permission tests.
13850 * -g <1>: Access permission tests.
13852 * -g: install invocation. (line 54)
13853 * -G: What information is listed.
13855 * -g <1>: What information is listed.
13857 * -g: sort invocation. (line 98)
13858 * -ge: Numeric tests. (line 16)
13859 * -gt: Numeric tests. (line 16)
13860 * -H: who invocation. (line 48)
13861 * -h: File type tests. (line 23)
13862 * -H: du invocation. (line 80)
13863 * -h: du invocation. (line 75)
13864 * -H: df invocation. (line 48)
13865 * -h: df invocation. (line 43)
13866 * -H: chgrp invocation. (line 70)
13867 * -h: chgrp invocation. (line 35)
13868 * -H: chown invocation. (line 143)
13869 * -h: chown invocation. (line 108)
13870 * -H: cp invocation. (line 109)
13871 * -h: What information is listed.
13873 * -H: Which files are listed.
13875 * -h <1>: pr invocation. (line 134)
13876 * -h: nl invocation. (line 79)
13877 * -H: Traversing symlinks. (line 18)
13878 * -h: Block size. (line 138)
13879 * -i <1>: env invocation. (line 45)
13880 * -i <2>: uname invocation. (line 35)
13881 * -i <3>: tee invocation. (line 30)
13882 * -i <4>: df invocation. (line 52)
13883 * -i: ln invocation. (line 71)
13884 * -I: rm invocation. (line 44)
13885 * -i <1>: rm invocation. (line 39)
13886 * -i <2>: mv invocation. (line 59)
13887 * -i <3>: cp invocation. (line 116)
13888 * -i: What information is listed.
13890 * -I: Which files are listed.
13892 * -i <1>: expand invocation. (line 34)
13893 * -i <2>: join invocation. (line 69)
13894 * -i <3>: uniq invocation. (line 59)
13895 * -i <4>: shuf invocation. (line 23)
13896 * -i <5>: sort invocation. (line 125)
13897 * -i <6>: pr invocation. (line 140)
13898 * -i <7>: base64 invocation. (line 35)
13899 * -i <8>: od invocation. (line 182)
13900 * -i: nl invocation. (line 83)
13901 * -J: pr invocation. (line 147)
13902 * -j: od invocation. (line 55)
13903 * -k <1>: Access permission tests.
13905 * -k <2>: du invocation. (line 85)
13906 * -k <3>: df invocation. (line 57)
13907 * -k <4>: General output formatting.
13909 * -k <5>: sort invocation. (line 193)
13910 * -k <6>: csplit invocation. (line 85)
13911 * -k: Block size. (line 138)
13912 * -l <1>: su invocation. (line 53)
13913 * -l: who invocation. (line 68)
13914 * -L <1>: File type tests. (line 23)
13915 * -L <2>: stat invocation. (line 17)
13916 * -L: du invocation. (line 96)
13917 * -l <1>: du invocation. (line 91)
13918 * -l: df invocation. (line 63)
13919 * -L <1>: chgrp invocation. (line 75)
13920 * -L <2>: chown invocation. (line 148)
13921 * -L: cp invocation. (line 125)
13922 * -l <1>: cp invocation. (line 121)
13923 * -l: What information is listed.
13925 * -L <1>: Which files are listed.
13927 * -L: wc invocation. (line 57)
13928 * -l <1>: wc invocation. (line 53)
13929 * -l <2>: split invocation. (line 30)
13930 * -l <3>: pr invocation. (line 156)
13931 * -l <4>: od invocation. (line 185)
13932 * -l: nl invocation. (line 87)
13933 * -L: Traversing symlinks. (line 22)
13934 * -le: Numeric tests. (line 16)
13935 * -lt: Numeric tests. (line 16)
13936 * -m <1>: su invocation. (line 64)
13937 * -m <2>: uname invocation. (line 41)
13938 * -m <3>: who invocation. (line 51)
13939 * -m <4>: du invocation. (line 101)
13940 * -m <5>: touch invocation. (line 73)
13941 * -m <6>: readlink invocation. (line 41)
13942 * -m <7>: mknod invocation. (line 43)
13943 * -m <8>: mkfifo invocation. (line 21)
13944 * -m <9>: mkdir invocation. (line 19)
13945 * -m <10>: install invocation. (line 60)
13946 * -m: General output formatting.
13948 * -M: sort invocation. (line 131)
13949 * -m <1>: sort invocation. (line 32)
13950 * -m <2>: wc invocation. (line 45)
13951 * -m: pr invocation. (line 164)
13952 * -n <1>: nice invocation. (line 44)
13953 * -n <2>: uname invocation. (line 46)
13954 * -n <3>: id invocation. (line 31)
13955 * -n <4>: String tests. (line 19)
13956 * -n <5>: echo invocation. (line 17)
13957 * -n <6>: readlink invocation. (line 46)
13958 * -n: ln invocation. (line 75)
13959 * -N: Formatting the file names.
13961 * -n <1>: What information is listed.
13963 * -n <2>: cut invocation. (line 55)
13964 * -n <3>: shuf invocation. (line 32)
13965 * -n <4>: sort invocation. (line 140)
13966 * -n <5>: csplit invocation. (line 80)
13967 * -n <6>: tail invocation. (line 130)
13968 * -n: head invocation. (line 30)
13969 * -N: pr invocation. (line 198)
13970 * -n: pr invocation. (line 177)
13971 * -N: od invocation. (line 63)
13972 * -n <1>: nl invocation. (line 95)
13973 * -n: cat invocation. (line 31)
13974 * -n NUMBER: shred invocation. (line 106)
13975 * -ne: Numeric tests. (line 16)
13976 * -nt: File characteristic tests.
13978 * -o <1>: uname invocation. (line 57)
13979 * -o: Connectives for test.
13981 * -O: Access permission tests.
13983 * -o <1>: install invocation. (line 72)
13984 * -o <2>: What information is listed.
13986 * -o <3>: shuf invocation. (line 37)
13987 * -o <4>: sort invocation. (line 213)
13988 * -o <5>: pr invocation. (line 204)
13989 * -o: od invocation. (line 188)
13990 * -ot: File characteristic tests.
13992 * -p <1>: su invocation. (line 64)
13993 * -p: uname invocation. (line 50)
13994 * -P: pathchk invocation. (line 42)
13995 * -p <1>: pathchk invocation. (line 29)
13996 * -p: File type tests. (line 28)
13997 * -P <1>: du invocation. (line 107)
13998 * -P <2>: df invocation. (line 74)
13999 * -P <3>: chgrp invocation. (line 79)
14000 * -P: chown invocation. (line 152)
14001 * -p <1>: rmdir invocation. (line 22)
14002 * -p <2>: mkdir invocation. (line 34)
14003 * -p <3>: install invocation. (line 78)
14004 * -p: cp invocation. (line 134)
14005 * -P: cp invocation. (line 129)
14006 * -p <1>: dircolors invocation.
14008 * -p <2>: General output formatting.
14010 * -p: nl invocation. (line 108)
14011 * -P: Traversing symlinks. (line 26)
14012 * -q <1>: who invocation. (line 55)
14013 * -q: readlink invocation. (line 52)
14014 * -Q: Formatting the file names.
14016 * -q <1>: Formatting the file names.
14018 * -q <2>: csplit invocation. (line 100)
14019 * -q <3>: tail invocation. (line 135)
14020 * -q: head invocation. (line 36)
14021 * -r: uname invocation. (line 61)
14022 * -R: Options for date. (line 36)
14023 * -r <1>: Options for date. (line 30)
14024 * -r <2>: id invocation. (line 36)
14025 * -r <3>: Access permission tests.
14027 * -r: touch invocation. (line 77)
14028 * -R <1>: chmod invocation. (line 69)
14029 * -R <2>: chgrp invocation. (line 66)
14030 * -R <3>: chown invocation. (line 140)
14031 * -R: rm invocation. (line 91)
14032 * -r <1>: rm invocation. (line 91)
14033 * -r: cp invocation. (line 200)
14034 * -R: cp invocation. (line 200)
14035 * -r: Sorting the output. (line 27)
14036 * -R <1>: Which files are listed.
14038 * -R: sort invocation. (line 162)
14039 * -r <1>: sort invocation. (line 157)
14040 * -r <2>: sum invocation. (line 25)
14041 * -r <3>: pr invocation. (line 211)
14042 * -r: tac invocation. (line 26)
14043 * -s <1>: su invocation. (line 75)
14044 * -s <2>: uname invocation. (line 65)
14045 * -s <3>: Options for date. (line 78)
14046 * -s <4>: who invocation. (line 59)
14047 * -s <5>: tty invocation. (line 18)
14048 * -s: File characteristic tests.
14050 * -S <1>: File type tests. (line 31)
14051 * -S: du invocation. (line 134)
14052 * -s <1>: du invocation. (line 130)
14053 * -s: readlink invocation. (line 52)
14054 * -S: ln invocation. (line 100)
14055 * -s: ln invocation. (line 94)
14056 * -S <1>: mv invocation. (line 94)
14057 * -S: install invocation. (line 92)
14058 * -s: install invocation. (line 88)
14059 * -S: cp invocation. (line 263)
14060 * -s: cp invocation. (line 255)
14061 * -S: Sorting the output. (line 32)
14062 * -s <1>: What information is listed.
14064 * -s <2>: paste invocation. (line 34)
14065 * -s <3>: cut invocation. (line 59)
14066 * -s: uniq invocation. (line 41)
14067 * -S: sort invocation. (line 237)
14068 * -s <1>: sort invocation. (line 231)
14069 * -s <2>: sum invocation. (line 31)
14070 * -s <3>: csplit invocation. (line 100)
14071 * -s: fold invocation. (line 29)
14072 * -S: pr invocation. (line 225)
14073 * -s <1>: pr invocation. (line 216)
14074 * -s <2>: fmt invocation. (line 47)
14075 * -s: od invocation. (line 191)
14076 * -S: od invocation. (line 68)
14077 * -s <1>: nl invocation. (line 112)
14078 * -s <2>: tac invocation. (line 33)
14079 * -s: cat invocation. (line 35)
14080 * -S: Backup options. (line 50)
14081 * -s BYTES: shred invocation. (line 117)
14082 * -su: su invocation. (line 25)
14083 * -T: who invocation. (line 86)
14084 * -t <1>: File type tests. (line 34)
14085 * -t: stat invocation. (line 48)
14086 * -T: df invocation. (line 113)
14087 * -t: df invocation. (line 107)
14088 * -T: ln invocation. (line 109)
14089 * -t: ln invocation. (line 105)
14090 * -T: mv invocation. (line 103)
14091 * -t: mv invocation. (line 99)
14092 * -T: install invocation. (line 101)
14093 * -t: install invocation. (line 97)
14094 * -T: cp invocation. (line 272)
14095 * -t: cp invocation. (line 268)
14096 * -T: General output formatting.
14098 * -t <1>: Sorting the output. (line 36)
14099 * -t <2>: unexpand invocation. (line 24)
14100 * -t: expand invocation. (line 22)
14101 * -T: sort invocation. (line 273)
14102 * -t <1>: sort invocation. (line 253)
14103 * -t: md5sum invocation. (line 79)
14104 * -T: pr invocation. (line 246)
14105 * -t <1>: pr invocation. (line 235)
14106 * -t <2>: fmt invocation. (line 40)
14107 * -t: od invocation. (line 76)
14108 * -T: cat invocation. (line 42)
14109 * -t: cat invocation. (line 38)
14110 * -u <1>: env invocation. (line 39)
14111 * -u <2>: Options for date. (line 83)
14112 * -u <3>: who invocation. (line 62)
14113 * -u <4>: id invocation. (line 41)
14114 * -u <5>: Access permission tests.
14116 * -u <6>: shred invocation. (line 123)
14117 * -u <7>: mv invocation. (line 76)
14118 * -u: cp invocation. (line 277)
14119 * -U: Sorting the output. (line 49)
14120 * -u <1>: Sorting the output. (line 42)
14121 * -u <2>: uniq invocation. (line 98)
14122 * -u <3>: sort invocation. (line 282)
14123 * -u <4>: fmt invocation. (line 53)
14124 * -u: cat invocation. (line 45)
14125 * -v <1>: uname invocation. (line 76)
14126 * -v <2>: chmod invocation. (line 59)
14127 * -v <3>: chgrp invocation. (line 58)
14128 * -v <4>: chown invocation. (line 132)
14129 * -v <5>: rmdir invocation. (line 31)
14130 * -v <6>: readlink invocation. (line 56)
14131 * -v <7>: mkdir invocation. (line 51)
14132 * -v <8>: ln invocation. (line 114)
14133 * -v <9>: shred invocation. (line 129)
14134 * -v <10>: rm invocation. (line 95)
14135 * -v <11>: mv invocation. (line 86)
14136 * -v <12>: install invocation. (line 106)
14137 * -v <13>: cp invocation. (line 287)
14138 * -v <14>: Sorting the output. (line 56)
14139 * -v <15>: tail invocation. (line 139)
14140 * -v <16>: head invocation. (line 40)
14141 * -v <17>: pr invocation. (line 251)
14142 * -v <18>: od invocation. (line 146)
14143 * -v <19>: nl invocation. (line 117)
14144 * -v: cat invocation. (line 49)
14145 * -w <1>: who invocation. (line 86)
14146 * -w <2>: Access permission tests.
14148 * -w <3>: General output formatting.
14150 * -w <4>: uniq invocation. (line 103)
14151 * -w <5>: md5sum invocation. (line 88)
14152 * -w <6>: wc invocation. (line 49)
14153 * -w: fold invocation. (line 35)
14154 * -W: pr invocation. (line 264)
14155 * -w <1>: pr invocation. (line 255)
14156 * -w <2>: fmt invocation. (line 59)
14157 * -w <3>: base64 invocation. (line 21)
14158 * -w <4>: od invocation. (line 153)
14159 * -w: nl invocation. (line 122)
14160 * -WIDTH: fmt invocation. (line 59)
14161 * -x <1>: Access permission tests.
14163 * -x <2>: du invocation. (line 191)
14164 * -x <3>: df invocation. (line 138)
14165 * -x <4>: shred invocation. (line 133)
14166 * -x <5>: cp invocation. (line 291)
14167 * -x: General output formatting.
14169 * -X: Sorting the output. (line 63)
14170 * -x: od invocation. (line 194)
14171 * -X FILE: du invocation. (line 201)
14172 * -z <1>: String tests. (line 15)
14173 * -z <2>: shred invocation. (line 143)
14174 * -z <3>: shuf invocation. (line 48)
14175 * -z <4>: sort invocation. (line 296)
14176 * -z: csplit invocation. (line 89)
14177 * .cshrc: su invocation. (line 44)
14178 * /: Numeric expressions. (line 15)
14179 * /bin/sh: su invocation. (line 12)
14180 * /etc/passwd: su invocation. (line 12)
14181 * /etc/shells: su invocation. (line 64)
14182 * 128-bit checksum: md5sum invocation. (line 6)
14183 * 16-bit checksum: sum invocation. (line 6)
14184 * 160-bit checksum: sha1sum invocation. (line 6)
14185 * 224-bit checksum: sha2 utilities. (line 6)
14186 * 256-bit checksum: sha2 utilities. (line 6)
14187 * 384-bit checksum: sha2 utilities. (line 6)
14188 * 4.2 file system type: df invocation. (line 125)
14189 * 512-bit checksum: sha2 utilities. (line 6)
14190 * <: Relations for expr. (line 22)
14191 * <=: Relations for expr. (line 22)
14192 * = <1>: Relations for expr. (line 22)
14193 * =: String tests. (line 22)
14194 * ==: Relations for expr. (line 22)
14195 * >: Relations for expr. (line 22)
14196 * >=: Relations for expr. (line 22)
14197 * \( regexp operator: String expressions. (line 24)
14198 * \+ regexp operator: String expressions. (line 28)
14199 * \? regexp operator: String expressions. (line 28)
14200 * \c: printf invocation. (line 23)
14201 * \OOO: printf invocation. (line 57)
14202 * \uhhhh: printf invocation. (line 62)
14203 * \Uhhhhhhhh: printf invocation. (line 62)
14204 * \xHH: printf invocation. (line 57)
14205 * \| regexp operator: String expressions. (line 28)
14206 * _POSIX2_VERSION <1>: touch invocation. (line 93)
14207 * _POSIX2_VERSION <2>: uniq invocation. (line 46)
14208 * _POSIX2_VERSION <3>: sort invocation. (line 328)
14209 * _POSIX2_VERSION <4>: tail invocation. (line 150)
14210 * _POSIX2_VERSION: Standards conformance.
14212 * abbreviations for months: Calendar date items. (line 38)
14213 * access permission tests: Access permission tests.
14215 * access permissions, changing: chmod invocation. (line 6)
14216 * access time: dd invocation. (line 171)
14217 * access time, changing: touch invocation. (line 50)
14218 * access time, printing or sorting files by: Sorting the output.
14220 * access time, show the most recent: du invocation. (line 149)
14221 * across columns: pr invocation. (line 84)
14222 * across, listing files: General output formatting.
14224 * adding permissions: Setting Permissions. (line 38)
14225 * addition: Numeric expressions. (line 11)
14226 * ago in date strings: Relative items in date strings.
14228 * all repeated lines, outputting: uniq invocation. (line 69)
14229 * alnum: Character sets. (line 91)
14230 * alpha: Character sets. (line 94)
14231 * alternate ebcdic, converting to: dd invocation. (line 67)
14232 * always color option: General output formatting.
14234 * always interactive option: rm invocation. (line 57)
14235 * am i: who invocation. (line 21)
14236 * am in date strings: Time of day items. (line 22)
14237 * and operator <1>: Relations for expr. (line 17)
14238 * and operator: Connectives for test.
14240 * append: dd invocation. (line 141)
14241 * appending to the output file: dd invocation. (line 141)
14242 * appropriate privileges <1>: nice invocation. (line 6)
14243 * appropriate privileges <2>: hostname invocation. (line 6)
14244 * appropriate privileges <3>: Setting the time. (line 6)
14245 * appropriate privileges: install invocation. (line 72)
14246 * arbitrary date strings, parsing: Options for date. (line 11)
14247 * arbitrary text, displaying: echo invocation. (line 6)
14248 * arithmetic tests: Numeric tests. (line 6)
14249 * ASCII dump of files: od invocation. (line 6)
14250 * ascii, converting to: dd invocation. (line 59)
14251 * atime, changing: touch invocation. (line 50)
14252 * atime, printing or sorting files by: Sorting the output. (line 42)
14253 * atime, show the most recent: du invocation. (line 149)
14254 * attributes, file: Changing file attributes.
14256 * authors of get_date: Authors of get_date. (line 6)
14257 * auto color option: General output formatting.
14259 * automounter file systems: df invocation. (line 32)
14260 * b for block special file: mknod invocation. (line 26)
14261 * background jobs, stopping at terminal write: Local. (line 41)
14262 * backslash escapes <1>: echo invocation. (line 20)
14263 * backslash escapes: Character sets. (line 14)
14264 * backslash sequences for file names: Formatting the file names.
14266 * backup files, ignoring: Which files are listed.
14268 * backup options: Backup options. (line 6)
14269 * backup suffix: Backup options. (line 50)
14270 * backups, making <1>: ln invocation. (line 55)
14271 * backups, making <2>: mv invocation. (line 50)
14272 * backups, making <3>: install invocation. (line 40)
14273 * backups, making <4>: cp invocation. (line 61)
14274 * backups, making: Backup options. (line 13)
14275 * backups, making only: cp invocation. (line 42)
14276 * base64: base64 invocation. (line 6)
14277 * Base64 decoding: base64 invocation. (line 29)
14278 * base64 encoding: base64 invocation. (line 6)
14279 * basename: basename invocation. (line 6)
14280 * baud rate, setting: Special. (line 43)
14281 * beeping at input buffer full: Input. (line 56)
14282 * beginning of time: Time conversion specifiers.
14284 * beginning of time, for POSIX: Seconds since the Epoch.
14286 * Bellovin, Steven M.: Authors of get_date. (line 6)
14287 * Berets, Jim: Authors of get_date. (line 6)
14288 * Berry, K. <1>: Authors of get_date. (line 14)
14289 * Berry, K.: Introduction. (line 19)
14290 * binary: dd invocation. (line 188)
14291 * binary I/O: dd invocation. (line 188)
14292 * binary input files: md5sum invocation. (line 38)
14293 * blank: Character sets. (line 97)
14294 * blank lines, numbering: nl invocation. (line 87)
14295 * blanks, ignoring leading: sort invocation. (line 79)
14296 * block (space-padding): dd invocation. (line 76)
14297 * block size <1>: dd invocation. (line 33)
14298 * block size: Block size. (line 6)
14299 * block size of conversion: dd invocation. (line 38)
14300 * block size of input: dd invocation. (line 25)
14301 * block size of output: dd invocation. (line 29)
14302 * block special check: File type tests. (line 10)
14303 * block special files: mknod invocation. (line 11)
14304 * block special files, creating: mknod invocation. (line 6)
14305 * BLOCK_SIZE: Block size. (line 12)
14306 * BLOCKSIZE: Block size. (line 12)
14307 * body, numbering: nl invocation. (line 17)
14308 * Bourne shell syntax for color setup: dircolors invocation.
14310 * breaks, cause interrupts: Input. (line 10)
14311 * breaks, ignoring: Input. (line 7)
14312 * brkint: Input. (line 10)
14313 * bs: dd invocation. (line 33)
14314 * BSD sum: sum invocation. (line 25)
14315 * BSD tail: tail invocation. (line 19)
14316 * BSD touch compatibility: touch invocation. (line 68)
14317 * bsN: Output. (line 55)
14318 * bugs, reporting: Introduction. (line 12)
14319 * built-in shell commands, conflicts with <1>: nice invocation.
14321 * built-in shell commands, conflicts with <2>: pwd invocation.
14323 * built-in shell commands, conflicts with: test invocation. (line 28)
14324 * byte count: wc invocation. (line 6)
14325 * byte-swapping: dd invocation. (line 95)
14326 * c for character special file: mknod invocation. (line 29)
14327 * C shell syntax for color setup: dircolors invocation.
14329 * C-s/C-q flow control: Input. (line 38)
14330 * calendar date item: Calendar date items. (line 6)
14331 * case folding: sort invocation. (line 92)
14332 * case translation: Local. (line 36)
14333 * case, ignored in dates: General date syntax. (line 64)
14334 * cat: cat invocation. (line 6)
14335 * cbreak: Combination. (line 52)
14336 * cbs: dd invocation. (line 38)
14337 * CD-ROM file system type: df invocation. (line 129)
14338 * cdfs file system type: df invocation. (line 129)
14339 * change or print terminal settings: stty invocation. (line 6)
14340 * changed files, verbosely describing: chgrp invocation. (line 20)
14341 * changed owners, verbosely describing: chown invocation. (line 70)
14342 * changing access permissions: chmod invocation. (line 6)
14343 * changing file attributes: Changing file attributes.
14345 * changing file ownership: chown invocation. (line 6)
14346 * changing file timestamps: touch invocation. (line 6)
14347 * changing group ownership <1>: chgrp invocation. (line 6)
14348 * changing group ownership: chown invocation. (line 6)
14349 * changing special mode bits: Changing Special Mode Bits.
14351 * character classes: Character sets. (line 78)
14352 * character count: wc invocation. (line 6)
14353 * character size: Control. (line 19)
14354 * character special check: File type tests. (line 13)
14355 * character special files: mknod invocation. (line 11)
14356 * character special files, creating: mknod invocation. (line 6)
14357 * characters, special: Characters. (line 6)
14358 * check file types: test invocation. (line 6)
14359 * checking for sortedness: sort invocation. (line 18)
14360 * checksum, 128-bit: md5sum invocation. (line 6)
14361 * checksum, 16-bit: sum invocation. (line 6)
14362 * checksum, 160-bit: sha1sum invocation. (line 6)
14363 * checksum, 224-bit: sha2 utilities. (line 6)
14364 * checksum, 256-bit: sha2 utilities. (line 6)
14365 * checksum, 384-bit: sha2 utilities. (line 6)
14366 * checksum, 512-bit: sha2 utilities. (line 6)
14367 * chgrp: chgrp invocation. (line 6)
14368 * chmod: chmod invocation. (line 6)
14369 * chown: chown invocation. (line 6)
14370 * chroot: chroot invocation. (line 6)
14371 * cksum: cksum invocation. (line 6)
14372 * clocal: Control. (line 33)
14373 * cntrl: Character sets. (line 100)
14374 * color database, printing: dircolors invocation.
14376 * color setup: dircolors invocation.
14378 * color, distinguishing file types with: General output formatting.
14380 * cols: Special. (line 27)
14381 * column to wrap data after: base64 invocation. (line 21)
14382 * COLUMNS: Special. (line 30)
14383 * columns: Special. (line 27)
14384 * COLUMNS: General output formatting.
14386 * combination settings: Combination. (line 6)
14387 * comm: comm invocation. (line 6)
14388 * command-line operands to shuffle: shuf invocation. (line 19)
14389 * commands for controlling processes: Process control. (line 6)
14390 * commands for delaying: Delaying. (line 6)
14391 * commands for exit status: Conditions. (line 6)
14392 * commands for file name manipulation: File name manipulation.
14394 * commands for invoking other commands: Modified command invocation.
14396 * commands for printing text: Printing text. (line 6)
14397 * commands for printing the working context: Working context. (line 6)
14398 * commands for printing user information: User information. (line 6)
14399 * commands for redirection: Redirection. (line 6)
14400 * commands for system context: System context. (line 6)
14401 * commas, outputting between files: General output formatting.
14403 * comments, in dates: General date syntax. (line 64)
14404 * common field, joining on: join invocation. (line 6)
14405 * common lines: comm invocation. (line 18)
14406 * common options: Common options. (line 6)
14407 * compare values: test invocation. (line 6)
14408 * comparing sorted files: comm invocation. (line 6)
14409 * comparison operators: Relations for expr. (line 22)
14410 * concatenate and write files: cat invocation. (line 6)
14411 * conditional executability: Conditional Executability.
14413 * conditions: Conditions. (line 6)
14414 * conflicts with shell built-ins <1>: nice invocation. (line 35)
14415 * conflicts with shell built-ins <2>: pwd invocation. (line 10)
14416 * conflicts with shell built-ins: test invocation. (line 28)
14417 * connectives, logical <1>: Relations for expr. (line 6)
14418 * connectives, logical: Connectives for test.
14420 * context splitting: csplit invocation. (line 6)
14421 * context, system: System context. (line 6)
14422 * control characters, using ^C: Local. (line 51)
14423 * control settings: Control. (line 6)
14424 * controlling terminal: dd invocation. (line 176)
14425 * conv: dd invocation. (line 53)
14426 * conversion block size: dd invocation. (line 38)
14427 * conversion specifiers, date: Date conversion specifiers.
14429 * conversion specifiers, literal: Literal conversion specifiers.
14431 * conversion specifiers, time: Time conversion specifiers.
14433 * converting tabs to spaces: expand invocation. (line 6)
14434 * converting while copying a file: dd invocation. (line 6)
14435 * cooked: Combination. (line 37)
14436 * Coordinated Universal Time: Options for date. (line 83)
14437 * copying directories recursively: cp invocation. (line 76)
14438 * copying existing permissions: Copying Permissions. (line 6)
14439 * copying files: cat invocation. (line 6)
14440 * copying files and directories: cp invocation. (line 6)
14441 * copying files and setting attributes: install invocation. (line 6)
14442 * core utilities: Top. (line 19)
14443 * count: dd invocation. (line 49)
14444 * cp: cp invocation. (line 6)
14445 * crashes and corruption: sync invocation. (line 11)
14446 * CRC checksum: cksum invocation. (line 6)
14447 * cread: Control. (line 30)
14448 * creating directories: mkdir invocation. (line 6)
14449 * creating FIFOs (named pipes): mkfifo invocation. (line 6)
14450 * creating links (hard only): link invocation. (line 6)
14451 * creating links (hard or soft): ln invocation. (line 6)
14452 * creating output file, avoiding: dd invocation. (line 103)
14453 * creating output file, requiring: dd invocation. (line 107)
14454 * crN: Output. (line 45)
14455 * crown margin: fmt invocation. (line 34)
14456 * crt: Combination. (line 74)
14457 * crterase: Local. (line 22)
14458 * crtkill: Local. (line 56)
14459 * crtscts: Control. (line 36)
14460 * csh syntax for color setup: dircolors invocation.
14462 * csN: Control. (line 19)
14463 * csplit: csplit invocation. (line 6)
14464 * cstopb: Control. (line 27)
14465 * ctime, printing or sorting by: Sorting the output. (line 13)
14466 * ctime, show the most recent: du invocation. (line 144)
14467 * ctlecho: Local. (line 51)
14468 * current working directory, printing: pwd invocation. (line 6)
14469 * cut: cut invocation. (line 6)
14470 * cyclic redundancy check: cksum invocation. (line 6)
14471 * data, erasing: shred invocation. (line 6)
14472 * database for color setup, printing: dircolors invocation.
14474 * date: date invocation. (line 6)
14475 * date conversion specifiers: Date conversion specifiers.
14477 * date format, ISO 8601: Calendar date items. (line 30)
14478 * date input formats: Date input formats. (line 6)
14479 * date options: Options for date. (line 6)
14480 * date strings, parsing: Options for date. (line 11)
14481 * day in date strings: Relative items in date strings.
14483 * day of week item: Day of week items. (line 6)
14484 * dd: dd invocation. (line 6)
14485 * dec: Combination. (line 77)
14486 * decctlq: Combination. (line 63)
14487 * Decode base64 data: base64 invocation. (line 29)
14488 * delay for a specified time: sleep invocation. (line 6)
14489 * delaying commands: Delaying. (line 6)
14490 * deleting characters: Squeezing. (line 6)
14491 * dereferencing symbolic links: ln invocation. (line 40)
14492 * descriptor follow option: tail invocation. (line 41)
14493 * destination directory <1>: ln invocation. (line 105)
14494 * destination directory <2>: mv invocation. (line 99)
14495 * destination directory <3>: install invocation. (line 97)
14496 * destination directory <4>: cp invocation. (line 268)
14497 * destination directory: Target directory. (line 15)
14498 * destinations, multiple output: tee invocation. (line 6)
14499 * device file, disk: df invocation. (line 19)
14500 * df: df invocation. (line 6)
14501 * DF_BLOCK_SIZE: Block size. (line 12)
14502 * dictionary order: sort invocation. (line 85)
14503 * differing lines: comm invocation. (line 18)
14504 * digit: Character sets. (line 103)
14505 * dir: dir invocation. (line 6)
14506 * dircolors: dircolors invocation.
14508 * direct: dd invocation. (line 149)
14509 * direct I/O: dd invocation. (line 149)
14510 * directories, copying: cp invocation. (line 6)
14511 * directories, copying recursively: cp invocation. (line 76)
14512 * directories, creating: mkdir invocation. (line 6)
14513 * directories, creating with given attributes: install invocation.
14515 * directories, removing (recursively): rm invocation. (line 91)
14516 * directories, removing empty: rmdir invocation. (line 6)
14517 * directory: dd invocation. (line 152)
14518 * directory check: File type tests. (line 16)
14519 * directory components, printing: dirname invocation. (line 6)
14520 * directory deletion, ignoring failures: rmdir invocation. (line 17)
14521 * directory deletion, reporting: rmdir invocation. (line 31)
14522 * directory I/O: dd invocation. (line 152)
14523 * directory listing: ls invocation. (line 6)
14524 * directory listing, brief: dir invocation. (line 6)
14525 * directory listing, recursive: Which files are listed.
14527 * directory listing, verbose: vdir invocation. (line 6)
14528 * directory order, listing by: Sorting the output. (line 20)
14529 * directory, stripping from file names: basename invocation. (line 6)
14530 * dired Emacs mode support: What information is listed.
14532 * dirname: dirname invocation. (line 6)
14533 * disabling special characters: Characters. (line 13)
14534 * disambiguating group names and IDs: Disambiguating names and IDs.
14536 * disk allocation: What information is listed.
14538 * disk device file: df invocation. (line 19)
14539 * disk usage: Disk usage. (line 6)
14540 * disk usage by file system: df invocation. (line 6)
14541 * disk usage for files: du invocation. (line 6)
14542 * diskette file system: df invocation. (line 133)
14543 * displacement of dates: Relative items in date strings.
14545 * displaying text: echo invocation. (line 6)
14546 * displaying value of a symbolic link: readlink invocation. (line 6)
14547 * division: Numeric expressions. (line 15)
14548 * do nothing, successfully: true invocation. (line 6)
14549 * do nothing, unsuccessfully: false invocation. (line 6)
14550 * DOS file system: df invocation. (line 133)
14551 * double spacing: pr invocation. (line 96)
14552 * down columns: pr invocation. (line 70)
14553 * dsusp: Characters. (line 53)
14554 * dsync: dd invocation. (line 157)
14555 * du: du invocation. (line 6)
14556 * DU_BLOCK_SIZE: Block size. (line 12)
14557 * ebcdic, converting to: dd invocation. (line 63)
14558 * echo <1>: Local. (line 18)
14559 * echo: echo invocation. (line 6)
14560 * echoctl: Local. (line 51)
14561 * echoe: Local. (line 22)
14562 * echok: Local. (line 26)
14563 * echoke: Local. (line 56)
14564 * echonl: Local. (line 29)
14565 * echoprt: Local. (line 46)
14566 * effective user and group IDs, printing: id invocation. (line 6)
14567 * effective user ID, printing: whoami invocation. (line 6)
14568 * efs file system type: df invocation. (line 125)
14569 * Eggert, Paul: Authors of get_date. (line 6)
14570 * eight-bit characters <1>: Combination. (line 55)
14571 * eight-bit characters: Control. (line 19)
14572 * eight-bit input: Input. (line 23)
14573 * ek: Combination. (line 22)
14574 * empty files, creating: touch invocation. (line 11)
14575 * empty lines, numbering: nl invocation. (line 87)
14576 * entire files, output of: Output of entire files.
14578 * env: env invocation. (line 6)
14579 * environment variables, printing: printenv invocation. (line 6)
14580 * environment, preserving: su invocation. (line 64)
14581 * environment, printing: env invocation. (line 30)
14582 * environment, running a program in a modified: env invocation.
14584 * eof: Characters. (line 32)
14585 * eol: Characters. (line 35)
14586 * eol2: Characters. (line 38)
14587 * epoch, for POSIX: Seconds since the Epoch.
14589 * epoch, seconds since: Time conversion specifiers.
14591 * equal string check: String tests. (line 22)
14592 * equivalence classes: Character sets. (line 127)
14593 * erase: Characters. (line 26)
14594 * erasing data: shred invocation. (line 6)
14595 * error messages, omitting <1>: chmod invocation. (line 45)
14596 * error messages, omitting <2>: chgrp invocation. (line 26)
14597 * error messages, omitting: chown invocation. (line 76)
14598 * evaluation of expressions: expr invocation. (line 6)
14599 * even parity: Control. (line 13)
14600 * evenp: Combination. (line 9)
14601 * exabyte, definition of: Block size. (line 116)
14602 * examples of date: Examples of date. (line 6)
14603 * examples of expr: Examples of expr. (line 6)
14604 * exbibyte, definition of: Block size. (line 120)
14605 * excl: dd invocation. (line 107)
14606 * excluding files from du: du invocation. (line 195)
14607 * executable file check: Access permission tests.
14609 * executables and file type, marking: General output formatting.
14611 * execute/search permission: Mode Structure. (line 18)
14612 * execute/search permission, symbolic: Setting Permissions. (line 63)
14613 * existence-of-file check: File characteristic tests.
14615 * existing backup method: Backup options. (line 39)
14616 * exit status commands: Conditions. (line 6)
14617 * exit status of chroot: chroot invocation. (line 47)
14618 * exit status of env: env invocation. (line 49)
14619 * exit status of expr: expr invocation. (line 39)
14620 * exit status of false: false invocation. (line 6)
14621 * exit status of ls: ls invocation. (line 29)
14622 * exit status of nice: nice invocation. (line 53)
14623 * exit status of nohup: nohup invocation. (line 42)
14624 * exit status of pathchk: pathchk invocation. (line 50)
14625 * exit status of printenv: printenv invocation. (line 17)
14626 * exit status of sort: sort invocation. (line 58)
14627 * exit status of su: su invocation. (line 80)
14628 * exit status of test: test invocation. (line 40)
14629 * exit status of true: true invocation. (line 6)
14630 * exit status of tty: tty invocation. (line 21)
14631 * expand: expand invocation. (line 6)
14632 * expr: expr invocation. (line 6)
14633 * expression evaluation <1>: expr invocation. (line 6)
14634 * expression evaluation: test invocation. (line 6)
14635 * expressions, numeric: Numeric expressions. (line 6)
14636 * expressions, string: String expressions. (line 6)
14637 * extension, sorting files by: Sorting the output. (line 63)
14638 * factor: factor invocation. (line 6)
14639 * failure exit status: false invocation. (line 6)
14640 * false: false invocation. (line 6)
14641 * fascism: su invocation. (line 87)
14642 * fdatasync: dd invocation. (line 121)
14643 * FDL, GNU Free Documentation License: GNU Free Documentation License.
14645 * ffN: Output. (line 63)
14646 * field separator character: sort invocation. (line 253)
14647 * fields, padding numeric: Padding and other flags.
14649 * FIFOs, creating: mkfifo invocation. (line 6)
14650 * file attributes, changing: Changing file attributes.
14652 * file characteristic tests: File characteristic tests.
14654 * file contents, dumping unambiguously: od invocation. (line 6)
14655 * file information, preserving: cp invocation. (line 134)
14656 * file mode bits, numeric: Numeric Modes. (line 6)
14657 * file name manipulation: File name manipulation.
14659 * file name pattern expansion, disabled: su invocation. (line 44)
14660 * file names, checking validity and portability: pathchk invocation.
14662 * file names, stripping directory and suffix: basename invocation.
14664 * file offset radix: od invocation. (line 36)
14665 * file ownership, changing: chown invocation. (line 6)
14666 * file sizes: du invocation. (line 45)
14667 * file space usage: du invocation. (line 6)
14668 * file status: stat invocation. (line 6)
14669 * file system disk usage: df invocation. (line 6)
14670 * file system sizes: df invocation. (line 38)
14671 * file system space, retrieving current data more slowly: df invocation.
14673 * file system space, retrieving old data more quickly: df invocation.
14675 * file system status: stat invocation. (line 6)
14676 * file system types, limiting output to certain: df invocation.
14678 * file system types, printing: df invocation. (line 113)
14679 * file systems: stat invocation. (line 23)
14680 * file systems and hard links: ln invocation. (line 6)
14681 * file systems, omitting copying to different: cp invocation. (line 291)
14682 * file timestamps, changing: touch invocation. (line 6)
14683 * file type and executables, marking: General output formatting.
14685 * file type tests: File type tests. (line 6)
14686 * file type, marking: General output formatting.
14688 * file types: Special file types. (line 9)
14689 * file types, special: Special file types. (line 6)
14690 * file utilities: Top. (line 19)
14691 * files beginning with -, removing: rm invocation. (line 98)
14692 * files, copying: cp invocation. (line 6)
14693 * fingerprint, 128-bit: md5sum invocation. (line 6)
14694 * fingerprint, 160-bit: sha1sum invocation. (line 6)
14695 * fingerprint, 224-bit: sha2 utilities. (line 6)
14696 * fingerprint, 256-bit: sha2 utilities. (line 6)
14697 * fingerprint, 384-bit: sha2 utilities. (line 6)
14698 * fingerprint, 512-bit: sha2 utilities. (line 6)
14699 * first in date strings: General date syntax. (line 26)
14700 * first part of files, outputting: head invocation. (line 6)
14701 * fixed-length records, converting to variable-length: dd invocation.
14703 * flow control, hardware: Control. (line 36)
14704 * flow control, software: Input. (line 43)
14705 * flushing, disabling: Local. (line 32)
14706 * fmt: fmt invocation. (line 6)
14707 * fold: fold invocation. (line 6)
14708 * folding long input lines: fold invocation. (line 6)
14709 * footers, numbering: nl invocation. (line 17)
14710 * force deletion: shred invocation. (line 101)
14711 * formatting file contents: Formatting file contents.
14713 * formatting of numbers in seq: seq invocation. (line 24)
14714 * formatting times <1>: date invocation. (line 20)
14715 * formatting times: pr invocation. (line 100)
14716 * fortnight in date strings: Relative items in date strings.
14718 * fsync: dd invocation. (line 125)
14719 * general date syntax: General date syntax. (line 6)
14720 * general numeric sort: sort invocation. (line 98)
14721 * get_date: Date input formats. (line 6)
14722 * gibibyte, definition of: Block size. (line 99)
14723 * gigabyte, definition of: Block size. (line 95)
14724 * giving away permissions: Umask and Protection.
14726 * globbing, disabled: su invocation. (line 44)
14727 * GMT: Options for date. (line 83)
14728 * grand total of disk space: du invocation. (line 50)
14729 * graph: Character sets. (line 106)
14730 * Greenwich Mean Time: Options for date. (line 83)
14731 * group IDs, disambiguating: Disambiguating names and IDs.
14733 * group names, disambiguating: Disambiguating names and IDs.
14735 * group owner, default: Mode Structure. (line 31)
14736 * group ownership of installed files, setting: install invocation.
14738 * group ownership, changing <1>: chgrp invocation. (line 6)
14739 * group ownership, changing: chown invocation. (line 6)
14740 * group wheel, not supported: su invocation. (line 87)
14741 * group, permissions for: Setting Permissions. (line 26)
14742 * groups: groups invocation. (line 6)
14743 * growing files: tail invocation. (line 41)
14744 * hangups, immunity to: nohup invocation. (line 6)
14745 * hard link check: File characteristic tests.
14747 * hard link, defined: ln invocation. (line 32)
14748 * hard links: dd invocation. (line 185)
14749 * hard links to directories: ln invocation. (line 61)
14750 * hard links, counting in du: du invocation. (line 91)
14751 * hard links, creating <1>: ln invocation. (line 6)
14752 * hard links, creating: link invocation. (line 6)
14753 * hard links, preserving: cp invocation. (line 89)
14754 * hardware class: uname invocation. (line 41)
14755 * hardware flow control: Control. (line 36)
14756 * hardware platform: uname invocation. (line 35)
14757 * hardware type: uname invocation. (line 41)
14758 * hat notation for control characters: Local. (line 51)
14759 * head: head invocation. (line 6)
14760 * head of output: shuf invocation. (line 32)
14761 * headers, numbering: nl invocation. (line 17)
14762 * help, online: Common options. (line 29)
14763 * hex dump of files: od invocation. (line 6)
14764 * High Sierra file system: df invocation. (line 129)
14765 * holes, copying files with: cp invocation. (line 216)
14766 * HOME: su invocation. (line 18)
14767 * horizontal, listing files: General output formatting.
14769 * host processor type: uname invocation. (line 50)
14770 * hostid: hostid invocation. (line 6)
14771 * hostname <1>: hostname invocation. (line 6)
14772 * hostname: uname invocation. (line 46)
14773 * hour in date strings: Relative items in date strings.
14775 * hsfs file system type: df invocation. (line 129)
14776 * human-readable output <1>: du invocation. (line 75)
14777 * human-readable output <2>: df invocation. (line 43)
14778 * human-readable output <3>: What information is listed.
14780 * human-readable output: Block size. (line 43)
14781 * hup[cl]: Control. (line 23)
14782 * hurd, author, printing: What information is listed.
14784 * ibs: dd invocation. (line 25)
14785 * icanon: Local. (line 11)
14786 * icrnl: Input. (line 32)
14787 * id: id invocation. (line 6)
14788 * idle time: who invocation. (line 62)
14789 * iexten: Local. (line 15)
14790 * if: dd invocation. (line 17)
14791 * iflag: dd invocation. (line 130)
14792 * ignbrk: Input. (line 7)
14793 * igncr: Input. (line 29)
14794 * ignore file systems: df invocation. (line 32)
14795 * Ignore garbage in base64 stream: base64 invocation. (line 35)
14796 * ignoring case: sort invocation. (line 92)
14797 * ignpar: Input. (line 13)
14798 * imaxbel: Input. (line 56)
14799 * immunity to hangups: nohup invocation. (line 6)
14800 * implementation, hardware: uname invocation. (line 35)
14801 * including files from du <1>: du invocation. (line 62)
14802 * including files from du: wc invocation. (line 60)
14803 * indenting lines: pr invocation. (line 204)
14804 * index: String expressions. (line 45)
14805 * information, about current users: who invocation. (line 6)
14806 * initial part of files, outputting: head invocation. (line 6)
14807 * initial tabs, converting: expand invocation. (line 34)
14808 * inlcr: Input. (line 26)
14809 * inode number, printing: What information is listed.
14811 * inode usage: df invocation. (line 52)
14812 * inode, and hard links: ln invocation. (line 32)
14813 * inodes, written buffered: sync invocation. (line 6)
14814 * inpck: Input. (line 20)
14815 * input block size: dd invocation. (line 25)
14816 * input encoding, UTF-8: Input. (line 35)
14817 * input range to shuffle: shuf invocation. (line 23)
14818 * input settings: Input. (line 6)
14819 * input tabs: pr invocation. (line 120)
14820 * install: install invocation. (line 6)
14821 * interactivity <1>: mv invocation. (line 64)
14822 * interactivity: cp invocation. (line 188)
14823 * intr: Characters. (line 20)
14824 * invocation of commands, modified: Modified command invocation.
14826 * isig: Local. (line 7)
14827 * ISO 8601 date format: Calendar date items. (line 30)
14828 * ISO/IEC 10646: printf invocation. (line 62)
14829 * ispeed: Special. (line 16)
14830 * istrip: Input. (line 23)
14831 * items in date strings: General date syntax. (line 6)
14832 * iterations, selecting the number of: shred invocation. (line 106)
14833 * iuclc: Input. (line 48)
14834 * iutf8: Input. (line 35)
14835 * ixany: Input. (line 52)
14836 * ixoff: Input. (line 43)
14837 * ixon: Input. (line 38)
14838 * join: join invocation. (line 6)
14839 * kernel name: uname invocation. (line 65)
14840 * kernel release: uname invocation. (line 61)
14841 * kernel version: uname invocation. (line 76)
14842 * kibibyte, definition of: Block size. (line 83)
14843 * kibibytes for file sizes: du invocation. (line 85)
14844 * kibibytes for file system sizes: df invocation. (line 57)
14845 * kill <1>: kill invocation. (line 6)
14846 * kill: Characters. (line 29)
14847 * kilobyte, definition of: Block size. (line 78)
14848 * Knuth, Donald E.: fmt invocation. (line 19)
14849 * language, in dates: General date syntax. (line 40)
14850 * last DAY <1>: Day of week items. (line 15)
14851 * last DAY: Options for date. (line 11)
14852 * last in date strings: General date syntax. (line 26)
14853 * last modified dates, displaying in du: du invocation. (line 138)
14854 * last part of files, outputting: tail invocation. (line 6)
14855 * LC_ALL <1>: ls invocation. (line 17)
14856 * LC_ALL: sort invocation. (line 49)
14857 * LC_COLLATE <1>: Relations for expr. (line 22)
14858 * LC_COLLATE <2>: join invocation. (line 14)
14859 * LC_COLLATE <3>: comm invocation. (line 12)
14860 * LC_COLLATE <4>: uniq invocation. (line 21)
14861 * LC_COLLATE: sort invocation. (line 49)
14862 * LC_CTYPE <1>: printf invocation. (line 62)
14863 * LC_CTYPE: sort invocation. (line 79)
14864 * LC_MESSAGES: pr invocation. (line 13)
14865 * LC_NUMERIC <1>: printf invocation. (line 51)
14866 * LC_NUMERIC <2>: sort invocation. (line 98)
14867 * LC_NUMERIC: Block size. (line 57)
14868 * LC_TIME <1>: date invocation. (line 11)
14869 * LC_TIME <2>: du invocation. (line 158)
14870 * LC_TIME <3>: Formatting file timestamps.
14872 * LC_TIME <4>: sort invocation. (line 131)
14873 * LC_TIME: pr invocation. (line 107)
14874 * LCASE: Combination. (line 71)
14875 * lcase: Combination. (line 71)
14876 * lcase, converting to: dd invocation. (line 87)
14877 * lchown <1>: chgrp invocation. (line 30)
14878 * lchown: chown invocation. (line 103)
14879 * leading directories, creating missing: install invocation. (line 48)
14880 * leading directory components, stripping: basename invocation.
14882 * left margin: pr invocation. (line 204)
14883 * length: String expressions. (line 50)
14884 * limiting output of du: du invocation. (line 111)
14885 * line: Special. (line 37)
14886 * line count: wc invocation. (line 6)
14887 * line numbering: nl invocation. (line 6)
14888 * line settings of terminal: stty invocation. (line 6)
14889 * line-breaking: fmt invocation. (line 19)
14890 * line-by-line comparison: comm invocation. (line 6)
14891 * LINES: Special. (line 30)
14892 * link: link invocation. (line 6)
14893 * links, creating <1>: ln invocation. (line 6)
14894 * links, creating: link invocation. (line 6)
14895 * Linux file system types: df invocation. (line 125)
14896 * literal conversion specifiers: Literal conversion specifiers.
14898 * litout: Combination. (line 59)
14899 * ln: ln invocation. (line 6)
14900 * ln format for nl: nl invocation. (line 98)
14901 * lnext: Characters. (line 62)
14902 * local file system types: df invocation. (line 125)
14903 * local settings: Local. (line 6)
14904 * logging out and continuing to run: nohup invocation. (line 6)
14905 * logical and operator <1>: Relations for expr. (line 17)
14906 * logical and operator: Connectives for test.
14908 * logical connectives <1>: Relations for expr. (line 6)
14909 * logical connectives: Connectives for test.
14911 * logical or operator <1>: Relations for expr. (line 11)
14912 * logical or operator: Connectives for test.
14914 * logical pages, numbering on: nl invocation. (line 12)
14915 * login name, printing: logname invocation. (line 6)
14916 * login sessions, printing users with: users invocation. (line 6)
14917 * login shell: su invocation. (line 18)
14918 * login shell, creating: su invocation. (line 53)
14919 * login time: who invocation. (line 11)
14920 * LOGNAME: su invocation. (line 18)
14921 * logname: logname invocation. (line 6)
14922 * long ls format: What information is listed.
14924 * lower: Character sets. (line 109)
14925 * lowercase, translating to output: Output. (line 12)
14926 * ls: ls invocation. (line 6)
14927 * LS_BLOCK_SIZE: Block size. (line 12)
14928 * LS_COLORS: dircolors invocation.
14930 * machine type: uname invocation. (line 41)
14931 * machine-readable stty output: stty invocation. (line 41)
14932 * MacKenzie, D.: Introduction. (line 19)
14933 * MacKenzie, David: Authors of get_date. (line 6)
14934 * Makefiles, installing programs in: install invocation. (line 30)
14935 * manipulating files: Basic operations. (line 6)
14936 * manipulation of file names: File name manipulation.
14938 * match: String expressions. (line 36)
14939 * matching patterns: String expressions. (line 11)
14940 * MD5: md5sum invocation. (line 6)
14941 * md5sum: md5sum invocation. (line 6)
14942 * mebibyte, definition of: Block size. (line 92)
14943 * mebibytes for file sizes: du invocation. (line 101)
14944 * megabyte, definition of: Block size. (line 88)
14945 * merging files: paste invocation. (line 6)
14946 * merging files in parallel: pr invocation. (line 6)
14947 * merging sorted files: sort invocation. (line 32)
14948 * message status: who invocation. (line 86)
14949 * message-digest, 128-bit: md5sum invocation. (line 6)
14950 * message-digest, 160-bit: sha1sum invocation. (line 6)
14951 * message-digest, 224-bit: sha2 utilities. (line 6)
14952 * message-digest, 256-bit: sha2 utilities. (line 6)
14953 * message-digest, 384-bit: sha2 utilities. (line 6)
14954 * message-digest, 512-bit: sha2 utilities. (line 6)
14955 * Meyering, J.: Introduction. (line 19)
14956 * Meyering, Jim: Authors of get_date. (line 6)
14957 * midnight in date strings: Time of day items. (line 22)
14958 * min: Special. (line 7)
14959 * minute in date strings: Relative items in date strings.
14961 * minutes, time zone correction by: Time of day items. (line 30)
14962 * MIT AI lab: su invocation. (line 92)
14963 * mkdir: mkdir invocation. (line 6)
14964 * mkfifo: mkfifo invocation. (line 6)
14965 * mknod: mknod invocation. (line 6)
14966 * modem control: Control. (line 33)
14967 * modes and umask: Umask and Protection.
14969 * modes of created directories, setting: mkdir invocation. (line 19)
14970 * modes of created FIFOs, setting: mkfifo invocation. (line 21)
14971 * modification time, sorting files by: Sorting the output. (line 36)
14972 * modified command invocation: Modified command invocation.
14974 * modified environment, running a program in a: env invocation.
14976 * modify time, changing: touch invocation. (line 73)
14977 * month in date strings: Relative items in date strings.
14979 * month names in date strings: Calendar date items. (line 38)
14980 * months, sorting by: sort invocation. (line 131)
14981 * months, written-out: General date syntax. (line 36)
14982 * MS-DOS file system: df invocation. (line 133)
14983 * mtime, changing: touch invocation. (line 73)
14984 * multicolumn output, generating: pr invocation. (line 6)
14985 * multiple changes to permissions: Multiple Changes. (line 6)
14986 * multiplication: Numeric expressions. (line 15)
14987 * multipliers after numbers: dd invocation. (line 204)
14988 * mv: mv invocation. (line 6)
14989 * name follow option: tail invocation. (line 41)
14990 * name of kernel: uname invocation. (line 65)
14991 * named pipe check: File type tests. (line 28)
14992 * named pipes, creating: mkfifo invocation. (line 6)
14993 * network node name: uname invocation. (line 46)
14994 * never interactive option: rm invocation. (line 52)
14995 * newer files, copying only: cp invocation. (line 277)
14996 * newer files, moving only: mv invocation. (line 76)
14997 * newer-than file check: File characteristic tests.
14999 * newline echoing after kill: Local. (line 26)
15000 * newline, echoing: Local. (line 29)
15001 * newline, translating to crlf: Output. (line 19)
15002 * newline, translating to return: Input. (line 26)
15003 * next DAY <1>: Day of week items. (line 15)
15004 * next DAY: Options for date. (line 11)
15005 * next in date strings: General date syntax. (line 26)
15006 * NFS file system type: df invocation. (line 120)
15007 * NFS mounts from BSD to HP-UX <1>: du invocation. (line 206)
15008 * NFS mounts from BSD to HP-UX: What information is listed.
15010 * nice: nice invocation. (line 6)
15011 * niceness: nice invocation. (line 6)
15012 * nl <1>: Combination. (line 18)
15013 * nl: nl invocation. (line 6)
15014 * nlN: Output. (line 39)
15015 * no-op: true invocation. (line 6)
15016 * noatime: dd invocation. (line 171)
15017 * nocreat: dd invocation. (line 103)
15018 * noctty: dd invocation. (line 176)
15019 * node name: uname invocation. (line 46)
15020 * noerror: dd invocation. (line 100)
15021 * noflsh: Local. (line 32)
15022 * nofollow: dd invocation. (line 182)
15023 * nohup: nohup invocation. (line 6)
15024 * nohup.out: nohup invocation. (line 6)
15025 * nolinks: dd invocation. (line 185)
15026 * non-directories, copying as special files: cp invocation. (line 76)
15027 * non-directory suffix, stripping: dirname invocation. (line 6)
15028 * nonblock: dd invocation. (line 168)
15029 * nonblocking I/O: dd invocation. (line 168)
15030 * none backup method: Backup options. (line 31)
15031 * none color option: General output formatting.
15033 * none, sorting option for ls: Sorting the output. (line 49)
15034 * nonempty file check: File characteristic tests.
15036 * nonprinting characters, ignoring: sort invocation. (line 125)
15037 * nonzero-length string check: String tests. (line 19)
15038 * noon in date strings: Time of day items. (line 22)
15039 * not-equal string check: String tests. (line 25)
15040 * notrunc: dd invocation. (line 113)
15041 * now in date strings: Relative items in date strings.
15043 * numbered backup method: Backup options. (line 35)
15044 * numbering lines: nl invocation. (line 6)
15045 * numbers, written-out: General date syntax. (line 26)
15046 * numeric expressions: Numeric expressions. (line 6)
15047 * numeric field padding: Padding and other flags.
15049 * numeric modes: Numeric Modes. (line 6)
15050 * numeric operations: Numeric operations. (line 6)
15051 * numeric sequences: seq invocation. (line 6)
15052 * numeric sort: sort invocation. (line 140)
15053 * numeric tests: Numeric tests. (line 6)
15054 * numeric uid and gid: What information is listed.
15056 * numeric user and group IDs: What information is listed.
15058 * obs: dd invocation. (line 29)
15059 * ocrnl: Output. (line 16)
15060 * octal dump of files: od invocation. (line 6)
15061 * octal numbers for file modes: Numeric Modes. (line 6)
15062 * od: od invocation. (line 6)
15063 * odd parity: Control. (line 13)
15064 * oddp: Combination. (line 14)
15065 * of: dd invocation. (line 20)
15066 * ofdel: Output. (line 34)
15067 * ofill: Output. (line 30)
15068 * oflag: dd invocation. (line 134)
15069 * olcuc: Output. (line 12)
15070 * older-than file check: File characteristic tests.
15072 * once interactive option: rm invocation. (line 54)
15073 * one file system, restricting du to: du invocation. (line 191)
15074 * one file system, restricting rm to: rm invocation. (line 63)
15075 * one-line output format: df invocation. (line 74)
15076 * onlcr: Output. (line 19)
15077 * onlret: Output. (line 27)
15078 * onocr: Output. (line 23)
15079 * operating on characters: Operating on characters.
15081 * operating on sorted files: Operating on sorted files.
15083 * operating system name: uname invocation. (line 57)
15084 * opost: Output. (line 9)
15085 * option delimiter: Common options. (line 36)
15086 * options for date: Options for date. (line 6)
15087 * or operator <1>: Relations for expr. (line 11)
15088 * or operator: Connectives for test.
15090 * ordinal numbers: General date syntax. (line 26)
15091 * ospeed: Special. (line 19)
15092 * other permissions: Setting Permissions. (line 29)
15093 * output block size: dd invocation. (line 29)
15094 * output file name prefix <1>: csplit invocation. (line 62)
15095 * output file name prefix: split invocation. (line 14)
15096 * output file name suffix: csplit invocation. (line 66)
15097 * output format: stat invocation. (line 28)
15098 * output format, portable: df invocation. (line 74)
15099 * output null-byte-terminated lines: du invocation. (line 117)
15100 * output of entire files: Output of entire files.
15102 * output of parts of files: Output of parts of files.
15104 * output settings: Output. (line 6)
15105 * output tabs: pr invocation. (line 140)
15106 * overwriting of input, allowed <1>: shuf invocation. (line 37)
15107 * overwriting of input, allowed: sort invocation. (line 213)
15108 * owned by effective group ID check: Access permission tests.
15110 * owned by effective user ID check: Access permission tests.
15112 * owner of file, permissions for: Setting Permissions. (line 23)
15113 * owner, default: Mode Structure. (line 31)
15114 * ownership of installed files, setting: install invocation. (line 72)
15115 * p for FIFO file: mknod invocation. (line 23)
15116 * pad character: Output. (line 34)
15117 * pad instead of timing for delaying: Output. (line 30)
15118 * padding of numeric fields: Padding and other flags.
15120 * paragraphs, reformatting: fmt invocation. (line 6)
15121 * parenb: Control. (line 9)
15122 * parent directories and cp: cp invocation. (line 177)
15123 * parent directories, creating: mkdir invocation. (line 34)
15124 * parent directories, creating missing: install invocation. (line 48)
15125 * parent directories, removing: rmdir invocation. (line 22)
15126 * parentheses for grouping: expr invocation. (line 31)
15127 * parity: Combination. (line 10)
15128 * parity errors, marking: Input. (line 16)
15129 * parity, ignoring: Input. (line 13)
15130 * parmrk: Input. (line 16)
15131 * parodd: Control. (line 13)
15132 * parsing date strings: Options for date. (line 11)
15133 * parts of files, output of: Output of parts of files.
15135 * pass8: Combination. (line 55)
15136 * passwd entry, and su shell: su invocation. (line 12)
15137 * paste: paste invocation. (line 6)
15138 * Paterson, R.: Introduction. (line 19)
15139 * PATH <1>: su invocation. (line 53)
15140 * PATH: env invocation. (line 24)
15141 * pathchk: pathchk invocation. (line 6)
15142 * pattern matching: String expressions. (line 11)
15143 * PC file system: df invocation. (line 133)
15144 * pcfs: df invocation. (line 133)
15145 * pebibyte, definition of: Block size. (line 113)
15146 * permission tests: Access permission tests.
15148 * permissions of installed files, setting: install invocation.
15150 * permissions, changing access: chmod invocation. (line 6)
15151 * permissions, copying existing: Copying Permissions. (line 6)
15152 * permissions, for changing file timestamps: touch invocation.
15154 * permissions, output by ls: What information is listed.
15156 * petabyte, definition of: Block size. (line 109)
15157 * phone directory order: sort invocation. (line 85)
15158 * pieces, splitting a file into: split invocation. (line 6)
15159 * Pinard, F. <1>: Authors of get_date. (line 14)
15160 * Pinard, F.: Introduction. (line 19)
15161 * pipe fitting: tee invocation. (line 6)
15162 * Plass, Michael F.: fmt invocation. (line 19)
15163 * platform, hardware: uname invocation. (line 35)
15164 * pm in date strings: Time of day items. (line 22)
15165 * portable file names, checking for: pathchk invocation. (line 6)
15166 * portable output format: df invocation. (line 74)
15167 * POSIX: Introduction. (line 11)
15168 * POSIX output format: df invocation. (line 74)
15169 * POSIXLY_CORRECT <1>: printf invocation. (line 42)
15170 * POSIXLY_CORRECT <2>: echo invocation. (line 68)
15171 * POSIXLY_CORRECT <3>: dd invocation. (line 237)
15172 * POSIXLY_CORRECT <4>: sort invocation. (line 221)
15173 * POSIXLY_CORRECT <5>: tail invocation. (line 75)
15174 * POSIXLY_CORRECT <6>: pr invocation. (line 107)
15175 * POSIXLY_CORRECT <7>: Standards conformance.
15177 * POSIXLY_CORRECT: Common options. (line 11)
15178 * POSIXLY_CORRECT, and block size: Block size. (line 12)
15179 * pr: pr invocation. (line 6)
15180 * prime factors: factor invocation. (line 6)
15181 * print: Character sets. (line 112)
15182 * print name of current directory: pwd invocation. (line 6)
15183 * print system information: uname invocation. (line 6)
15184 * print terminal file name: tty invocation. (line 6)
15185 * printenv: printenv invocation. (line 6)
15186 * printf: printf invocation. (line 6)
15187 * printing all or some environment variables: printenv invocation.
15189 * printing color database: dircolors invocation.
15191 * printing current user information: who invocation. (line 6)
15192 * printing current usernames: users invocation. (line 6)
15193 * printing groups a user is in: groups invocation. (line 6)
15194 * printing real and effective user and group IDs: id invocation.
15196 * printing text: echo invocation. (line 6)
15197 * printing text, commands for: Printing text. (line 6)
15198 * printing the current time: date invocation. (line 6)
15199 * printing the effective user ID: whoami invocation. (line 6)
15200 * printing the host identifier: hostid invocation. (line 6)
15201 * printing the hostname: hostname invocation. (line 6)
15202 * printing user's login name: logname invocation. (line 6)
15203 * printing, preparing files for: pr invocation. (line 6)
15204 * processes, commands for controlling: Process control. (line 6)
15205 * prompting, and ln: ln invocation. (line 71)
15206 * prompting, and mv: mv invocation. (line 34)
15207 * prompting, and rm: rm invocation. (line 11)
15208 * prompts, forcing: mv invocation. (line 59)
15209 * prompts, omitting: mv invocation. (line 55)
15210 * prterase: Local. (line 46)
15211 * ptx: ptx invocation. (line 6)
15212 * punct: Character sets. (line 115)
15213 * pure numbers in date strings: Pure numbers in date strings.
15215 * pwd: pwd invocation. (line 6)
15216 * quit: Characters. (line 23)
15217 * quoting style: Formatting the file names.
15219 * radix for file offsets: od invocation. (line 36)
15220 * random sort: sort invocation. (line 162)
15221 * random source for shredding: shred invocation. (line 112)
15222 * random source for shuffling: shuf invocation. (line 43)
15223 * random source for sorting: sort invocation. (line 226)
15224 * random sources: Random sources. (line 6)
15225 * ranges: Character sets. (line 50)
15226 * raw: Combination. (line 43)
15227 * read errors, ignoring: dd invocation. (line 100)
15228 * read from stdin and write to stdout and files: tee invocation.
15230 * read permission: Mode Structure. (line 12)
15231 * read permission, symbolic: Setting Permissions. (line 57)
15232 * read system call, and holes: cp invocation. (line 216)
15233 * readable file check: Access permission tests.
15235 * readlink: readlink invocation. (line 6)
15236 * real user and group IDs, printing: id invocation. (line 6)
15237 * recursive directory listing: Which files are listed.
15239 * recursively changing access permissions: chmod invocation. (line 69)
15240 * recursively changing file ownership: chown invocation. (line 140)
15241 * recursively changing group ownership: chgrp invocation. (line 66)
15242 * recursively copying directories: cp invocation. (line 76)
15243 * redirection: Redirection. (line 6)
15244 * reformatting paragraph text: fmt invocation. (line 6)
15245 * regular expression matching: String expressions. (line 11)
15246 * regular file check: File type tests. (line 19)
15247 * relations, numeric or string: Relations for expr. (line 6)
15248 * relative items in date strings: Relative items in date strings.
15250 * release of kernel: uname invocation. (line 61)
15251 * remainder: Numeric expressions. (line 15)
15252 * remote hostname: who invocation. (line 11)
15253 * removing empty directories: rmdir invocation. (line 6)
15254 * removing files after shredding: shred invocation. (line 123)
15255 * removing files or directories: rm invocation. (line 6)
15256 * removing files or directories (via the unlink syscall): unlink invocation.
15258 * removing permissions: Setting Permissions. (line 42)
15259 * repeated characters: Character sets. (line 71)
15260 * repeated lines, outputting: uniq invocation. (line 63)
15261 * repeated output of a string: yes invocation. (line 6)
15262 * restricted deletion flag: Mode Structure. (line 56)
15263 * restricted shell: su invocation. (line 64)
15264 * return, ignoring: Input. (line 29)
15265 * return, translating to newline <1>: Output. (line 16)
15266 * return, translating to newline: Input. (line 32)
15267 * reverse sorting <1>: Sorting the output. (line 27)
15268 * reverse sorting: sort invocation. (line 157)
15269 * reversing files: tac invocation. (line 6)
15270 * rm: rm invocation. (line 6)
15271 * rmdir: rmdir invocation. (line 6)
15272 * rn format for nl: nl invocation. (line 101)
15273 * root as default owner: install invocation. (line 72)
15274 * root directory, allow recursive destruction: rm invocation. (line 84)
15275 * root directory, allow recursive modification <1>: chmod invocation.
15277 * root directory, allow recursive modification <2>: chgrp invocation.
15279 * root directory, allow recursive modification: chown invocation.
15281 * root directory, disallow recursive destruction: rm invocation.
15283 * root directory, disallow recursive modification <1>: chmod invocation.
15285 * root directory, disallow recursive modification <2>: chgrp invocation.
15287 * root directory, disallow recursive modification: chown invocation.
15289 * root directory, running a program in a specified: chroot invocation.
15291 * root, becoming: su invocation. (line 6)
15292 * rows: Special. (line 22)
15293 * rprnt: Characters. (line 56)
15294 * RTS/CTS flow control: Control. (line 36)
15295 * running a program in a modified environment: env invocation.
15297 * running a program in a specified root directory: chroot invocation.
15299 * rz format for nl: nl invocation. (line 104)
15300 * Salz, Rich: Authors of get_date. (line 6)
15301 * same file check: File characteristic tests.
15303 * sane: Combination. (line 26)
15304 * scheduling, affecting: nice invocation. (line 6)
15305 * screen columns: fold invocation. (line 14)
15306 * seconds since the epoch: Time conversion specifiers.
15308 * section delimiters of pages: nl invocation. (line 68)
15309 * seek: dd invocation. (line 46)
15310 * self-backups: cp invocation. (line 42)
15311 * send a signal to processes: kill invocation. (line 6)
15312 * sentences and line-breaking: fmt invocation. (line 19)
15313 * separator for numbers in seq: seq invocation. (line 42)
15314 * seq: seq invocation. (line 6)
15315 * sequence of numbers: seq invocation. (line 6)
15316 * set-group-ID: Mode Structure. (line 49)
15317 * set-group-ID check: Access permission tests.
15319 * set-user-ID: Mode Structure. (line 42)
15320 * set-user-ID check: Access permission tests.
15322 * setgid: Mode Structure. (line 49)
15323 * setting permissions: Setting Permissions. (line 46)
15324 * setting the hostname: hostname invocation. (line 6)
15325 * setting the time: Setting the time. (line 6)
15326 * setuid: Mode Structure. (line 42)
15327 * setup for color: dircolors invocation.
15329 * sh syntax for color setup: dircolors invocation.
15331 * SHA-1: sha1sum invocation. (line 6)
15332 * SHA-2: sha2 utilities. (line 6)
15333 * sha1sum: sha1sum invocation. (line 6)
15334 * sha224sum: sha2 utilities. (line 6)
15335 * sha256sum: sha2 utilities. (line 6)
15336 * sha384sum: sha2 utilities. (line 6)
15337 * sha512sum: sha2 utilities. (line 6)
15338 * SHELL: su invocation. (line 18)
15339 * SHELL environment variable, and color: dircolors invocation.
15341 * shell utilities: Top. (line 19)
15342 * shred: shred invocation. (line 6)
15343 * shuf: shuf invocation. (line 6)
15344 * shuffling files: shuf invocation. (line 6)
15345 * SI output <1>: du invocation. (line 123)
15346 * SI output <2>: df invocation. (line 93)
15347 * SI output <3>: What information is listed.
15349 * SI output: Block size. (line 43)
15350 * simple backup method: Backup options. (line 44)
15351 * SIMPLE_BACKUP_SUFFIX: Backup options. (line 50)
15352 * single-column output of files: General output formatting.
15354 * size: Special. (line 30)
15355 * size for main memory sorting: sort invocation. (line 237)
15356 * size of file to shred: shred invocation. (line 117)
15357 * size of files, reporting: What information is listed.
15359 * size of files, sorting files by: Sorting the output. (line 32)
15360 * skip: dd invocation. (line 43)
15361 * sleep: sleep invocation. (line 6)
15362 * socket check: File type tests. (line 31)
15363 * software flow control: Input. (line 43)
15364 * sort: sort invocation. (line 6)
15365 * sort field: sort invocation. (line 193)
15366 * sort stability: sort invocation. (line 38)
15367 * sort zero-terminated lines <1>: shuf invocation. (line 48)
15368 * sort zero-terminated lines: sort invocation. (line 296)
15369 * sort's last-resort comparison: sort invocation. (line 38)
15370 * sorted files, operations on: Operating on sorted files.
15372 * sorting files: sort invocation. (line 6)
15373 * sorting ls output: Sorting the output. (line 6)
15374 * space: Character sets. (line 118)
15375 * sparse files, copying: cp invocation. (line 216)
15376 * special characters: Characters. (line 6)
15377 * special file types: Special file types. (line 6)
15378 * special files: mknod invocation. (line 11)
15379 * special settings: Special. (line 6)
15380 * specifying sets of characters: Character sets. (line 6)
15381 * speed: Special. (line 40)
15382 * split: split invocation. (line 6)
15383 * splitting a file into pieces: split invocation. (line 6)
15384 * splitting a file into pieces by context: csplit invocation. (line 6)
15385 * squeezing blank lines: cat invocation. (line 35)
15386 * squeezing repeat characters: Squeezing. (line 6)
15387 * Stallman, R.: Introduction. (line 19)
15388 * standard input: Common options. (line 41)
15389 * standard output: Common options. (line 41)
15390 * start: Characters. (line 44)
15391 * stat: stat invocation. (line 6)
15392 * status time, printing or sorting by: Sorting the output. (line 13)
15393 * status time, show the most recent: du invocation. (line 144)
15394 * sticky: Mode Structure. (line 56)
15395 * sticky bit check: Access permission tests.
15397 * stop: Characters. (line 47)
15398 * stop bits: Control. (line 27)
15399 * strftime and date: date invocation. (line 20)
15400 * string constants, outputting: od invocation. (line 68)
15401 * string expressions: String expressions. (line 6)
15402 * string tests: String tests. (line 6)
15403 * strip directory and suffix from file names: basename invocation.
15405 * stripping non-directory suffix: dirname invocation. (line 6)
15406 * stripping symbol table information: install invocation. (line 88)
15407 * stripping trailing slashes <1>: mv invocation. (line 89)
15408 * stripping trailing slashes: cp invocation. (line 250)
15409 * stty: stty invocation. (line 6)
15410 * su: su invocation. (line 6)
15411 * substitute user and group IDs: su invocation. (line 6)
15412 * substr: String expressions. (line 40)
15413 * subtracting permissions: Setting Permissions. (line 42)
15414 * subtraction: Numeric expressions. (line 11)
15415 * successful exit: true invocation. (line 6)
15416 * suffix, stripping from file names: basename invocation. (line 6)
15417 * sum: sum invocation. (line 6)
15418 * summarizing files: Summarizing files. (line 6)
15419 * super-user, becoming: su invocation. (line 6)
15420 * superblock, writing: sync invocation. (line 6)
15421 * supplementary groups, printing: groups invocation. (line 6)
15422 * susp: Characters. (line 50)
15423 * swab (byte-swapping): dd invocation. (line 95)
15424 * swap space, saving text image in: Mode Structure. (line 56)
15425 * swtch: Characters. (line 41)
15426 * symbol table information, stripping: install invocation. (line 88)
15427 * symbolic (soft) links, creating: ln invocation. (line 6)
15428 * symbolic link check: File type tests. (line 23)
15429 * symbolic link to directory, controlling traversal of: Traversing symlinks.
15431 * symbolic link to directory, never traverse <1>: chgrp invocation.
15433 * symbolic link to directory, never traverse <2>: chown invocation.
15435 * symbolic link to directory, never traverse: Traversing symlinks.
15437 * symbolic link to directory, traverse each that is encountered <1>: chgrp invocation.
15439 * symbolic link to directory, traverse each that is encountered <2>: chown invocation.
15441 * symbolic link to directory, traverse each that is encountered: Traversing symlinks.
15443 * symbolic link to directory, traverse each that is specified on the command line <1>: chgrp invocation.
15445 * symbolic link to directory, traverse each that is specified on the command line <2>: chown invocation.
15447 * symbolic link to directory, traverse each that is specified on the command line: Traversing symlinks.
15449 * symbolic link, defined: ln invocation. (line 40)
15450 * symbolic links and pwd: pwd invocation. (line 6)
15451 * symbolic links, changing group: chgrp invocation. (line 35)
15452 * symbolic links, changing owner <1>: chgrp invocation. (line 30)
15453 * symbolic links, changing owner: chown invocation. (line 80)
15454 * symbolic links, copying: cp invocation. (line 89)
15455 * symbolic links, copying with: cp invocation. (line 255)
15456 * symbolic links, dereferencing: Which files are listed.
15458 * symbolic links, dereferencing in du: du invocation. (line 96)
15459 * symbolic links, dereferencing in stat: stat invocation. (line 17)
15460 * symbolic links, following: dd invocation. (line 182)
15461 * symbolic links, permissions of: chmod invocation. (line 10)
15462 * symbolic modes: Symbolic Modes. (line 6)
15463 * sync <1>: sync invocation. (line 6)
15464 * sync: dd invocation. (line 165)
15465 * sync (padding with nulls): dd invocation. (line 116)
15466 * synchronize disk and memory: sync invocation. (line 6)
15467 * synchronized data and metadata I/O: dd invocation. (line 165)
15468 * synchronized data and metadata writes, before finishing: dd invocation.
15470 * synchronized data reads: dd invocation. (line 157)
15471 * synchronized data writes, before finishing: dd invocation. (line 121)
15472 * syslog: su invocation. (line 29)
15473 * system context: System context. (line 6)
15474 * system information, printing: uname invocation. (line 6)
15475 * system name, printing: hostname invocation. (line 6)
15476 * System V sum: sum invocation. (line 31)
15477 * tab stops, setting: expand invocation. (line 22)
15478 * tabN: Output. (line 51)
15479 * tabs: Combination. (line 66)
15480 * tabs to spaces, converting: expand invocation. (line 6)
15481 * tac: tac invocation. (line 6)
15482 * tagged paragraphs: fmt invocation. (line 40)
15483 * tail: tail invocation. (line 6)
15484 * tandem: Input. (line 43)
15485 * target directory <1>: ln invocation. (line 105)
15486 * target directory <2>: mv invocation. (line 99)
15487 * target directory <3>: install invocation. (line 97)
15488 * target directory <4>: cp invocation. (line 268)
15489 * target directory: Target directory. (line 6)
15490 * tebibyte, definition of: Block size. (line 106)
15491 * tee: tee invocation. (line 6)
15492 * telephone directory order: sort invocation. (line 85)
15493 * temporary directory: sort invocation. (line 273)
15494 * terabyte, definition of: Block size. (line 102)
15495 * TERM: su invocation. (line 53)
15496 * terminal check: File type tests. (line 34)
15497 * terminal file name, printing: tty invocation. (line 6)
15498 * terminal lines, currently used: who invocation. (line 11)
15499 * terminal settings: stty invocation. (line 6)
15500 * terminal, using color iff: General output formatting.
15502 * terse output: stat invocation. (line 48)
15503 * test: test invocation. (line 6)
15504 * text: dd invocation. (line 192)
15505 * text I/O: dd invocation. (line 192)
15506 * text image, saving in swap space: Mode Structure. (line 56)
15507 * text input files: md5sum invocation. (line 79)
15508 * text utilities: Top. (line 19)
15509 * text, displaying: echo invocation. (line 6)
15510 * text, reformatting: fmt invocation. (line 6)
15511 * this in date strings: Relative items in date strings.
15513 * time <1>: Special. (line 11)
15514 * time: touch invocation. (line 58)
15515 * time conversion specifiers: Time conversion specifiers.
15517 * time formats <1>: date invocation. (line 20)
15518 * time formats: pr invocation. (line 100)
15519 * time of day item: Time of day items. (line 6)
15520 * time setting: Setting the time. (line 6)
15521 * time style <1>: du invocation. (line 153)
15522 * time style: Formatting file timestamps.
15524 * time units: sleep invocation. (line 11)
15525 * time zone correction: Time of day items. (line 30)
15526 * time zone item <1>: Time zone items. (line 6)
15527 * time zone item: General date syntax. (line 44)
15528 * time, printing or setting: date invocation. (line 6)
15529 * TIME_STYLE <1>: du invocation. (line 181)
15530 * TIME_STYLE: Formatting file timestamps.
15532 * timestamps of installed files, preserving: install invocation.
15534 * timestamps, changing file: touch invocation. (line 6)
15535 * TMPDIR: sort invocation. (line 64)
15536 * today in date strings: Relative items in date strings.
15538 * tomorrow: Options for date. (line 11)
15539 * tomorrow in date strings: Relative items in date strings.
15541 * topological sort: tsort invocation. (line 6)
15542 * tostop: Local. (line 41)
15543 * total counts: wc invocation. (line 12)
15544 * touch: touch invocation. (line 6)
15545 * tr: tr invocation. (line 6)
15546 * trailing slashes: Trailing slashes. (line 6)
15547 * translating characters: Translating. (line 6)
15548 * true: true invocation. (line 6)
15549 * truncating output file, avoiding: dd invocation. (line 113)
15550 * tsort: tsort invocation. (line 6)
15551 * tty: tty invocation. (line 6)
15552 * Twenex: su invocation. (line 92)
15553 * two-way parity: Control. (line 9)
15554 * type size: od invocation. (line 113)
15555 * TZ <1>: Specifying time zone rules.
15557 * TZ <2>: Options for date. (line 83)
15558 * TZ <3>: date invocation. (line 16)
15559 * TZ <4>: who invocation. (line 26)
15560 * TZ <5>: stat invocation. (line 131)
15561 * TZ <6>: touch invocation. (line 37)
15562 * TZ <7>: Formatting file timestamps.
15564 * TZ: pr invocation. (line 113)
15565 * u, and disabling special characters: Characters. (line 13)
15566 * ucase, converting to: dd invocation. (line 90)
15567 * ufs file system type: df invocation. (line 125)
15568 * umask and modes: Umask and Protection.
15570 * uname: uname invocation. (line 6)
15571 * unblock: dd invocation. (line 81)
15572 * unexpand: unexpand invocation. (line 6)
15573 * Unicode: printf invocation. (line 62)
15574 * uniq: uniq invocation. (line 6)
15575 * unique lines, outputting: uniq invocation. (line 98)
15576 * uniquify files: uniq invocation. (line 6)
15577 * uniquifying output: sort invocation. (line 282)
15578 * unlink: unlink invocation. (line 6)
15579 * unprintable characters, ignoring: sort invocation. (line 125)
15580 * unsorted directory listing: Sorting the output. (line 20)
15581 * upper: Character sets. (line 121)
15582 * uppercase, translating to lowercase: Input. (line 48)
15583 * use time, changing: touch invocation. (line 50)
15584 * use time, printing or sorting files by: Sorting the output. (line 13)
15585 * use time, show the most recent: du invocation. (line 144)
15586 * USER: su invocation. (line 18)
15587 * user ID, switching: su invocation. (line 6)
15588 * user IDs, disambiguating: Disambiguating names and IDs.
15590 * user information, commands for: User information. (line 6)
15591 * user name, printing: logname invocation. (line 6)
15592 * user names, disambiguating: Disambiguating names and IDs.
15594 * usernames, printing current: users invocation. (line 6)
15595 * users: users invocation. (line 6)
15596 * UTC: Options for date. (line 83)
15597 * utmp <1>: who invocation. (line 15)
15598 * utmp <2>: users invocation. (line 14)
15599 * utmp: logname invocation. (line 6)
15600 * valid file names, checking for: pathchk invocation. (line 6)
15601 * variable-length records, converting to fixed-length: dd invocation.
15603 * vdir: vdir invocation. (line 6)
15604 * verbose ls format: What information is listed.
15606 * verifying MD5 checksums: md5sum invocation. (line 69)
15607 * version number, finding: Common options. (line 33)
15608 * version of kernel: uname invocation. (line 76)
15609 * version, sorting option for ls: Sorting the output. (line 56)
15610 * version-control Emacs variable: Backup options. (line 24)
15611 * VERSION_CONTROL <1>: ln invocation. (line 55)
15612 * VERSION_CONTROL <2>: mv invocation. (line 50)
15613 * VERSION_CONTROL <3>: install invocation. (line 40)
15614 * VERSION_CONTROL <4>: cp invocation. (line 61)
15615 * VERSION_CONTROL: Backup options. (line 13)
15616 * vertical sorted files in columns: General output formatting.
15618 * vtN: Output. (line 59)
15619 * wc: wc invocation. (line 6)
15620 * week in date strings: Relative items in date strings.
15622 * werase: Characters. (line 59)
15623 * wheel group, not supported: su invocation. (line 87)
15624 * who: who invocation. (line 6)
15625 * who am i: who invocation. (line 21)
15626 * whoami: whoami invocation. (line 6)
15627 * word count: wc invocation. (line 6)
15628 * working context: Working context. (line 6)
15629 * working directory, printing: pwd invocation. (line 6)
15630 * wrap data: base64 invocation. (line 21)
15631 * wrapping long input lines: fold invocation. (line 6)
15632 * writable file check: Access permission tests.
15634 * write permission: Mode Structure. (line 15)
15635 * write permission, symbolic: Setting Permissions. (line 60)
15636 * write, allowed: who invocation. (line 86)
15637 * wtmp <1>: who invocation. (line 15)
15638 * wtmp: users invocation. (line 14)
15639 * xcase: Local. (line 36)
15640 * xdigit: Character sets. (line 124)
15641 * XON/XOFF flow control: Input. (line 38)
15642 * year in date strings: Relative items in date strings.
15644 * yes: yes invocation. (line 6)
15645 * yesterday: Options for date. (line 11)
15646 * yesterday in date strings: Relative items in date strings.
15648 * yottabyte, definition of: Block size. (line 131)
15649 * Youmans, B.: Introduction. (line 19)
15650 * zero-length string check: String tests. (line 15)
15651 * zettabyte, definition of: Block size. (line 123)
15652 * |: Relations for expr. (line 11)
15658 Node: Introduction
\7f20818
15659 Node: Common options
\7f22377
15660 Node: Exit status
\7f25162
15661 Node: Backup options
\7f25892
15662 Node: Block size
\7f27816
15663 Node: Disambiguating names and IDs
\7f32732
15664 Ref: Disambiguating names and IDs-Footnote-1
\7f34290
15665 Node: Random sources
\7f34360
15666 Node: Target directory
\7f36109
15667 Node: Trailing slashes
\7f39594
15668 Node: Traversing symlinks
\7f40615
15669 Node: Treating / specially
\7f41686
15670 Node: Special built-in utilities
\7f43227
15671 Node: Standards conformance
\7f44362
15672 Node: Output of entire files
\7f45878
15673 Node: cat invocation
\7f46479
15674 Node: tac invocation
\7f48207
15675 Node: nl invocation
\7f49469
15676 Node: od invocation
\7f53348
15677 Node: base64 invocation
\7f59711
15678 Node: Formatting file contents
\7f61073
15679 Node: fmt invocation
\7f61524
15680 Node: pr invocation
\7f64337
15681 Node: fold invocation
\7f77122
15682 Node: Output of parts of files
\7f78582
15683 Node: head invocation
\7f79090
15684 Node: tail invocation
\7f80806
15685 Node: split invocation
\7f88629
15686 Node: csplit invocation
\7f90715
15687 Node: Summarizing files
\7f94827
15688 Node: wc invocation
\7f95475
15689 Node: sum invocation
\7f98360
15690 Node: cksum invocation
\7f99765
15691 Node: md5sum invocation
\7f100905
15692 Node: sha1sum invocation
\7f105599
15693 Node: sha2 utilities
\7f106379
15694 Node: Operating on sorted files
\7f107003
15695 Node: sort invocation
\7f107659
15696 Ref: sort invocation-Footnote-1
\7f127034
15697 Node: shuf invocation
\7f127586
15698 Node: uniq invocation
\7f130150
15699 Node: comm invocation
\7f134230
15700 Node: tsort invocation
\7f135558
15701 Node: tsort background
\7f138592
15702 Node: ptx invocation
\7f140355
15703 Node: General options in ptx
\7f143159
15704 Node: Charset selection in ptx
\7f143740
15705 Node: Input processing in ptx
\7f144642
15706 Node: Output formatting in ptx
\7f150063
15707 Node: Compatibility in ptx
\7f156629
15708 Node: Operating on fields within a line
\7f159858
15709 Node: cut invocation
\7f160262
15710 Node: paste invocation
\7f163581
15711 Node: join invocation
\7f164909
15712 Node: Operating on characters
\7f169133
15713 Node: tr invocation
\7f169569
15714 Node: Character sets
\7f171287
15715 Node: Translating
\7f175718
15716 Node: Squeezing
\7f177809
15717 Node: expand invocation
\7f180876
15718 Node: unexpand invocation
\7f182358
15719 Node: Directory listing
\7f184176
15720 Node: ls invocation
\7f184662
15721 Ref: ls invocation-Footnote-1
\7f186476
15722 Node: Which files are listed
\7f186698
15723 Node: What information is listed
\7f190358
15724 Node: Sorting the output
\7f199334
15725 Node: More details about version sort
\7f201654
15726 Node: General output formatting
\7f203152
15727 Node: Formatting file timestamps
\7f207060
15728 Node: Formatting the file names
\7f212401
15729 Node: dir invocation
\7f215317
15730 Node: vdir invocation
\7f215728
15731 Node: dircolors invocation
\7f216106
15732 Node: Basic operations
\7f217586
15733 Node: cp invocation
\7f218206
15734 Node: dd invocation
\7f230266
15735 Node: install invocation
\7f238684
15736 Node: mv invocation
\7f242911
15737 Node: rm invocation
\7f247201
15738 Node: shred invocation
\7f251515
15739 Node: Special file types
\7f259000
15740 Node: link invocation
\7f260496
15741 Node: ln invocation
\7f261502
15742 Node: mkdir invocation
\7f266564
15743 Node: mkfifo invocation
\7f268813
15744 Node: mknod invocation
\7f269818
15745 Node: readlink invocation
\7f271577
15746 Node: rmdir invocation
\7f273320
15747 Node: unlink invocation
\7f274593
15748 Node: Changing file attributes
\7f275552
15749 Node: chown invocation
\7f276366
15750 Node: chgrp invocation
\7f282552
15751 Node: chmod invocation
\7f285602
15752 Node: touch invocation
\7f288357
15753 Node: Disk usage
\7f292953
15754 Node: df invocation
\7f293545
15755 Node: du invocation
\7f299217
15756 Node: stat invocation
\7f307207
15757 Node: sync invocation
\7f311049
15758 Node: Printing text
\7f311976
15759 Node: echo invocation
\7f312350
15760 Node: printf invocation
\7f314527
15761 Node: yes invocation
\7f319234
15762 Node: Conditions
\7f319846
15763 Node: false invocation
\7f320437
15764 Node: true invocation
\7f321472
15765 Node: test invocation
\7f322751
15766 Node: File type tests
\7f324711
15767 Node: Access permission tests
\7f325593
15768 Node: File characteristic tests
\7f326478
15769 Node: String tests
\7f327243
15770 Node: Numeric tests
\7f327908
15771 Node: Connectives for test
\7f328705
15772 Node: expr invocation
\7f329058
15773 Node: String expressions
\7f331319
15774 Node: Numeric expressions
\7f333902
15775 Node: Relations for expr
\7f334540
15776 Node: Examples of expr
\7f335740
15777 Node: Redirection
\7f336468
15778 Node: tee invocation
\7f336913
15779 Node: File name manipulation
\7f337978
15780 Node: basename invocation
\7f338426
15781 Node: dirname invocation
\7f339873
15782 Node: pathchk invocation
\7f341079
15783 Node: Working context
\7f342743
15784 Node: pwd invocation
\7f343387
15785 Node: stty invocation
\7f344061
15786 Node: Control
\7f346821
15787 Node: Input
\7f347581
15788 Node: Output
\7f349057
15789 Node: Local
\7f350313
15790 Node: Combination
\7f351895
15791 Node: Characters
\7f354057
15792 Node: Special
\7f355611
15793 Node: printenv invocation
\7f356977
15794 Node: tty invocation
\7f357740
15795 Node: User information
\7f358446
15796 Node: id invocation
\7f359081
15797 Node: logname invocation
\7f360297
15798 Node: whoami invocation
\7f360924
15799 Node: groups invocation
\7f361411
15800 Node: users invocation
\7f362147
15801 Node: who invocation
\7f363094
15802 Node: System context
\7f365863
15803 Node: date invocation
\7f366353
15804 Node: Time conversion specifiers
\7f368011
15805 Node: Date conversion specifiers
\7f370411
15806 Node: Literal conversion specifiers
\7f373535
15807 Node: Padding and other flags
\7f373893
15808 Node: Setting the time
\7f376087
15809 Node: Options for date
\7f377093
15810 Node: Examples of date
\7f380398
15811 Ref: %s-examples
\7f381841
15812 Node: uname invocation
\7f384026
15813 Node: hostname invocation
\7f386599
15814 Node: hostid invocation
\7f387212
15815 Node: Modified command invocation
\7f387899
15816 Node: chroot invocation
\7f388525
15817 Node: env invocation
\7f390644
15818 Node: nice invocation
\7f392723
15819 Node: nohup invocation
\7f396219
15820 Node: su invocation
\7f398210
15821 Node: Process control
\7f402683
15822 Node: kill invocation
\7f402906
15823 Node: Delaying
\7f407272
15824 Node: sleep invocation
\7f407469
15825 Node: Numeric operations
\7f408333
15826 Node: factor invocation
\7f408665
15827 Node: seq invocation
\7f410003
15828 Node: File permissions
\7f414284
15829 Node: Mode Structure
\7f414902
15830 Node: Symbolic Modes
\7f418597
15831 Node: Setting Permissions
\7f419695
15832 Node: Copying Permissions
\7f422308
15833 Node: Changing Special Mode Bits
\7f423127
15834 Node: Conditional Executability
\7f424949
15835 Node: Multiple Changes
\7f425493
15836 Node: Umask and Protection
\7f427160
15837 Node: Numeric Modes
\7f428265
15838 Node: Directory Setuid and Setgid
\7f430165
15839 Node: Date input formats
\7f432427
15840 Node: General date syntax
\7f434780
15841 Node: Calendar date items
\7f437739
15842 Node: Time of day items
\7f439744
15843 Node: Time zone items
\7f441868
15844 Node: Day of week items
\7f443110
15845 Node: Relative items in date strings
\7f444107
15846 Node: Pure numbers in date strings
\7f446917
15847 Node: Seconds since the Epoch
\7f447906
15848 Node: Specifying time zone rules
\7f449535
15849 Node: Authors of get_date
\7f451907
15850 Node: Opening the software toolbox
\7f452667
15851 Node: Toolbox introduction
\7f453328
15852 Node: I/O redirection
\7f456051
15853 Node: The who command
\7f458885
15854 Node: The cut command
\7f459782
15855 Node: The sort command
\7f460845
15856 Node: The uniq command
\7f461549
15857 Node: Putting the tools together
\7f462239
15858 Ref: Putting the tools together-Footnote-1
\7f474196
15859 Node: Copying This Manual
\7f474270
15860 Node: GNU Free Documentation License
\7f474525
15861 Node: Index
\7f496926