*** UNIX MANUAL PAGE BROWSER ***

A Nergahak database for man pages research.

Navigation

Directory Browser

1Browse 4.4BSD4.4BSD
1Browse Digital UNIXDigital UNIX 4.0e
1Browse FreeBSDFreeBSD 14.3
1Browse MINIXMINIX 3.4.0rc6-d5e4fc0
1Browse NetBSDNetBSD 10.1
1Browse OpenBSDOpenBSD 7.7
1Browse UNIX v7Version 7 UNIX
1Browse UNIX v10Version 10 UNIX

Manual Page Search

Manual Page Result

0 Command: truncate | Section: 1 | Source: MINIX | File: truncate.1
TRUNCATE(1) FreeBSD General Commands Manual TRUNCATE(1) NAME truncate - truncate or extend the length of files SYNOPSIS truncate [-c] -s [+|-]size[K|k|M|m|G|g] file ... truncate [-c] -r rfile file ... DESCRIPTION The truncate utility adjusts the length of each regular file given on the command-line. The following options are available: -c Do not create files if they do not exist. The truncate utility does not treat this as an error. No error messages are displayed and the exit value is not affected. -r rfile Truncate files to the length of the file rfile. -s [+|-]size[K|k|M|m|G|g] If the size argument is preceded by a plus sign (+), files will be extended by this number of bytes. If the size argument is preceded by a dash (-), file lengths will be reduced by no more than this number of bytes, to a minimum length of zero bytes. Otherwise, the size argument specifies an absolute length to which all files should be extended or reduced as appropriate. The size argument may be suffixed with one of K, M or G (either upper or lower case) to indicate a multiple of Kilobytes, Megabytes or Gigabytes respectively. Exactly one of the -r and -s options must be specified. If a file is made smaller, its extra data is lost. If a file is made larger, it will be extended as if by writing bytes with the value zero. If the file does not exist, it is created unless the -c option is specified. Note that, while truncating a file causes space on disk to be freed, extending a file does not cause space to be allocated. To extend a file and actually allocate the space, it is necessary to explicitly write data to it, using (for example) the shell's `>>' redirection syntax, or dd(1). EXIT STATUS The utility exits 0 on success, and >0 if an error occurs. If the operation fails for an argument, truncate will issue a diagnostic and continue processing the remaining arguments. SEE ALSO dd(1), touch(1), truncate(2) STANDARDS The truncate utility conforms to no known standards. HISTORY The truncate utility first appeared in FreeBSD 4.2. AUTHORS The truncate utility was written by Sheldon Hearn <[email protected]>. FreeBSD 14.1-RELEASE-p8 July 4, 2000 FreeBSD 14.1-RELEASE-p8

Navigation Options