From nobody Fri Mar 14 01:57:13 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ZDSD95xn5z5qJMG; Fri, 14 Mar 2025 01:57:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ZDSD92Jltz3nP1; Fri, 14 Mar 2025 01:57:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741917433; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JX79eJ1iM1TnS+2Eugxhn7RjdgJoPQwh53stIeDuI98=; b=ZtywXhmkSuxSPJ32rCXdTqvrtLb0JR/P835/4K4usFdLE5lHFKOqSkLvtbumi96YGG4HXF gLzf2oxUSrmKsgOtjNYqmMWlrUsOiQ1B1fQ64y8+68oLCOuBY9IEPPn9t27yYCJXwEjgtI Alv0YWhfQZPa7iiVnLBbpub6ircYYPRDgGJvAcylpm3A70eHSEb/G2Gy77rP2UL5jMmkeB QWCYGpAxoYX2MPsVEq7h+cWd4FMNHjHQJrFUcn2tLpm4KfxoYqdoaSk7uTvXRjF+kE8LIR +minm6Oqtf+N36Qg2J0w3N4QT2gI5Phl+otNnNZn3PLiYZeUeGyic8mmlww5mw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741917433; a=rsa-sha256; cv=none; b=eQZQ1VgtI5ERHF5fOHU6jP0kKrLvf0gQ+MRGEOIcQtkjQLxaLD2nzLeELPxKbOk0LQUy0g g1iM1XL9IP1Ll3KKFbaeO3Ku/AOdhtSnGBKuA1QbhWbj3IojJfZ48ypLPqNya89NpiB+uq sAN4vPVVydP8nWkgJhmsiQSwe8Tic3m870xXQ102ApmvHMgYgokPQT2xpRmmzsoxnxyomk BI8fzuT7gBnyem8TtKL6gJ8VezWbhR9Fru7knI8RSImlAl/STg60MOlYlIb9AhQgLsi2Qi zWXwq2xNgBI7enPHVR+SP5NRf/ZnGPCGC7sKfLCLJCGoEMXupCqBJg73stq7RA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741917433; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JX79eJ1iM1TnS+2Eugxhn7RjdgJoPQwh53stIeDuI98=; b=aJYhOiKxU8g1ZIPyXkE599Xfl0Cup5f4Z8aNnt8wpuVotdOtE1ZUzF2+cssRc6OGBWIHfY vzwhFJ1MuKyr3ucXLVjAnCGvKpeaSDt6oKpZ1qUyrRyT5LEsn+q1mVMVJR6p0DH1jZt6P+ +yjBSWQXXc0oZgY2PnrtZTECJ2241zPsWmv4XAPZ4uin3kIVonMCM+KuQWG7BdZBj/VPGh 10EbPPR+713WyqLkO3iFz0CF72rk58WSayxSyxnceqUglTgcUCoa8zwVXuhVwqrD2FdDNn +6FLrXkyb2eDxrV3Ogfp6Ma5DFsrR9jCZmnlCTOh0ZJkBRIzq9rIzix1Csm4RA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ZDSD91Gm8z7tx; Fri, 14 Mar 2025 01:57:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 52E1vDrI055651; Fri, 14 Mar 2025 01:57:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 52E1vDlb055648; Fri, 14 Mar 2025 01:57:13 GMT (envelope-from git) Date: Fri, 14 Mar 2025 01:57:13 GMT Message-Id: <202503140157.52E1vDlb055648@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Maxim Konovalov Subject: git: 6207ca7b76b0 - stable/14 - truncate.1: improve the example section List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: maxim X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 6207ca7b76b0410ed95d82d6d85ee60fe3138998 Auto-Submitted: auto-generated The branch stable/14 has been updated by maxim: URL: https://cgit.FreeBSD.org/src/commit/?id=6207ca7b76b0410ed95d82d6d85ee60fe3138998 commit 6207ca7b76b0410ed95d82d6d85ee60fe3138998 Author: Maxim Konovalov AuthorDate: 2025-03-07 01:45:21 +0000 Commit: Maxim Konovalov CommitDate: 2025-03-14 01:55:55 +0000 truncate.1: improve the example section Notably: * spell "Megabytes" as "megabytes" consistently; * remove a stray asterisk from the /boot/kernel/kernel listing * avoid using a shell prompt in the examples consistently * fixes the size parameter * add an example how to increase the file size PR: 273997 MFC after: 1 week (cherry picked from commit 5460bdda9d4cb3ce1d7431824b6f53c545888b53) --- usr.bin/truncate/truncate.1 | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/usr.bin/truncate/truncate.1 b/usr.bin/truncate/truncate.1 index 649749ddf255..f6b8b0cc37c9 100644 --- a/usr.bin/truncate/truncate.1 +++ b/usr.bin/truncate/truncate.1 @@ -27,7 +27,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd August 19, 2021 +.Dd March 6, 2025 .Dt TRUNCATE 1 .Os .Sh NAME @@ -188,14 +188,14 @@ and continue processing the remaining arguments. .Sh EXAMPLES Adjust the size of the file .Pa test_file -to 10 Megabytes but do not create it if it does not exist: +to 10 megabytes but do not create it if it does not exist: .Bd -literal -offset indent -truncate -c -s +10M test_file +truncate -c -s 10M test_file .Ed .Pp Same as above but create the file if it does not exist: .Bd -literal -offset indent -truncate -s +10M test_file +truncate -s 10M test_file ls -l test_file -rw-r--r-- 1 root wheel 10485760 Jul 22 18:48 test_file .Ed @@ -208,18 +208,28 @@ with the same size: .Bd -literal -offset indent truncate -r /boot/kernel/kernel test_file test_file2 ls -l /boot/kernel/kernel test_file* --r-xr-xr-x 1 root wheel 31352552 May 15 14:18 /boot/kernel/kernel* +-r-xr-xr-x 1 root wheel 31352552 May 15 14:18 /boot/kernel/kernel -rw-r--r-- 1 root wheel 31352552 Jul 22 19:15 test_file -rw-r--r-- 1 root wheel 31352552 Jul 22 19:15 test_file2 .Ed .Pp -Downsize +Increase the size of the file .Pa test_file -in 5 Megabytes: +by 5 megabytes but do not create it if it does not exist: .Bd -literal -offset indent -# truncate -s -5M test_file +truncate -s +5M test_file ls -l test_file* --rw-r--r-- 1 root wheel 26109672 Jul 22 19:17 test_file +-rw-r--r-- 1 root wheel 36595432 Sep 20 19:17 test_file +-rw-r--r-- 1 root wheel 31352552 Sep 20 19:15 test_file2 +.Ed +.Pp +Reduce the size of the file +.Pa test_file +by 5 megabytes: +.Bd -literal -offset indent +truncate -s -5M test_file +ls -l test_file* +-rw-r--r-- 1 root wheel 31352552 Jul 22 19:19 test_file -rw-r--r-- 1 root wheel 31352552 Jul 22 19:15 test_file2 .Ed .Sh SEE ALSO