truncate man page on FreeBSD

Man page or keyword search:  
man Server   9747 pages
apropos Keyword Search (all sections)
Output format
FreeBSD logo
[printable version]

TRUNCATE(1)		  BSD General Commands Manual		   TRUNCATE(1)

     truncatetruncate or extend the length of files

     truncate [-c] -s [+|-]size[K|k|M|m|G|g|T|t] file ...
     truncate [-c] -r rfile file ...

     The truncate utility adjusts the length of each regular file given on the

     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 or extend files to the length of the file rfile.

     -s [+|-]size[K|k|M|m|G|g|T|t]
	     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, G or T
	     (either upper or lower case) to indicate a multiple of Kilobytes,
	     Megabytes, Gigabytes or Terabytes 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 speci‐

     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).

     The truncate 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.

     dd(1), touch(1), truncate(2)

     The truncate utility conforms to no known standards.

     The truncate utility first appeared in FreeBSD 4.2.

     The truncate utility was written by Sheldon Hearn

BSD			       December 19, 2006			   BSD

List of man pages available for FreeBSD

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
Vote for polarhome
Free Shell Accounts :: the biggest list on the net