1TRUNCATE(1) User Commands TRUNCATE(1)
2
3
4
6 truncate - shrink or extend the size of a file to the specified size
7
9 truncate OPTION... FILE...
10
12 Shrink or extend the size of each FILE to the specified size
13
14 A FILE argument that does not exist is created.
15
16 If a FILE is larger than the specified size, the extra data is lost.
17 If a FILE is shorter, it is extended and the extended part (hole) reads
18 as zero bytes.
19
20 Mandatory arguments to long options are mandatory for short options
21 too.
22
23 -c, --no-create
24 do not create any files
25
26 -o, --io-blocks
27 treat SIZE as number of IO blocks instead of bytes
28
29 -r, --reference=FILE
30 use this FILE's size
31
32 -s, --size=SIZE
33 use this SIZE
34
35 --help display this help and exit
36
37 --version
38 output version information and exit
39
40 SIZE may be (or may be an integer optionally followed by) one of fol‐
41 lowing: KB 1000, K 1024, MB 1000*1000, M 1024*1024, and so on for G, T,
42 P, E, Z, Y.
43
44 SIZE may also be prefixed by one of the following modifying characters:
45 `+' extend by, `-' reduce by, `<' at most, `>' at least, `/' round down
46 to multiple of, `%' round up to multiple of.
47
48 Note that the -r and -s options are mutually exclusive.
49
51 Written by Padraig Brady.
52
54 Report truncate bugs to bug-coreutils@gnu.org
55 GNU coreutils home page: <http://www.gnu.org/software/coreutils/>
56 General help using GNU software: <http://www.gnu.org/gethelp/>
57 Report truncate translation bugs to <http://translationpro‐
58 ject.org/team/>
59
61 Copyright © 2010 Free Software Foundation, Inc. License GPLv3+: GNU
62 GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
63 This is free software: you are free to change and redistribute it.
64 There is NO WARRANTY, to the extent permitted by law.
65
67 dd(1), truncate(2), ftruncate(2)
68
69 The full documentation for truncate is maintained as a Texinfo manual.
70 If the info and truncate programs are properly installed at your site,
71 the command
72
73 info coreutils 'truncate invocation'
74
75 should give you access to the complete manual.
76
77
78
79GNU coreutils 8.5 November 2010 TRUNCATE(1)