From 6a2f098e72e71437154ec00506e8e736aa8e1026 Mon Sep 17 00:00:00 2001 From: Soccera1 <129828376+Soccera1@users.noreply.github.com> Date: Tue, 28 Jul 2026 15:54:54 +1000 Subject: Add docs --- man/truncate.1 | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 man/truncate.1 (limited to 'man/truncate.1') diff --git a/man/truncate.1 b/man/truncate.1 new file mode 100644 index 0000000..b6fc045 --- /dev/null +++ b/man/truncate.1 @@ -0,0 +1,71 @@ +.\" Adapted for BNU from the GNU Coreutils 9.11 manual page; see doc/README.md. +.TH TRUNCATE "1" "2026-07-28" "BNU 9.11" "BNU Commands" +.SH NAME +truncate \- shrink or extend the size of a file to the specified size +.SH SYNOPSIS +.B truncate +\fI\,OPTION\/\fR... \fI\,FILE\/\fR... +.SH DESCRIPTION +.\" This page is derived from GNU Coreutils documentation. +This page documents BNU, an independent Bun implementation compatible with +GNU Coreutils 9.11. +.PP +Shrink or extend the size of each FILE to the specified size +.PP +A FILE argument that does not exist is created. +.PP +If a FILE is larger than the specified size, the extra data is lost. +If a FILE is shorter, it is extended and the sparse extended part (hole) +reads as zero bytes. +.PP +Mandatory arguments to long options are mandatory for short options too. +.TP +\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#truncate-c'\fB\-c, \-\-no\-create\fP\X'tty: link' +do not create any files +.TP +\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#truncate-o'\fB\-o, \-\-io\-blocks\fP\X'tty: link' +treat SIZE as number of IO blocks instead of bytes +.TP +\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#truncate-r'\fB\-r, \-\-reference=\,RFILE\fP\X'tty: link'\/\fR +base size on RFILE +.TP +\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#truncate-s'\fB\-s, \-\-size=\,SIZE\fP\X'tty: link'\/\fR +set or adjust the file size by SIZE bytes +.TP +\X'tty: link https://www.gnu.org/software/coreutils/truncate#truncate--help'\fB\-\-help\fP\X'tty: link' +display this help and exit +.TP +\X'tty: link https://www.gnu.org/software/coreutils/truncate#truncate--version'\fB\-\-version\fP\X'tty: link' +output version information and exit +.PP +The SIZE argument is an integer and optional unit (example: 10K is 10*1024). +Units are K,M,G,T,P,E,Z,Y,R,Q (powers of 1024) or KB,MB,... (powers of 1000). +Binary prefixes can be used, too: KiB=K, MiB=M, and so on. +.PP +SIZE may also be prefixed by one of the following modifying characters: +\&'+' extend by, '\-' reduce by, '<' at most, '>' at least, +\&'/' round down to multiple of, '%' round up to multiple of. +.SH AUTHORS +Upstream GNU Coreutils documentation authors: +Written by Padraig Brady. +.br +Adapted for BNU; the BNU implementation is independent. +.SH "REPORTING BUGS" +Report BNU bugs at . +.br +For upstream GNU Coreutils, see . +.SH COPYRIGHT +Copyright \(co 2026 Free Software Foundation, Inc. +.br +This manual page was adapted for BNU in 2026. +License GPLv3+: GNU GPL version 3 or later . +.br +This is free software: you are free to change and redistribute it. +There is NO WARRANTY, to the extent permitted by law. +.SH "SEE ALSO" +\fBdd\fP(1), \fBtruncate\fP(2), \fBftruncate\fP(2) +.PP +.br +Upstream documentation +.br +BNU documentation is available locally via: info \(aq(bnu) truncate invocation\(aq -- cgit v1.3