From nobody Wed Jul 9 17:53:01 2025 X-Original-To: dev-commits-src-main@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 4bclv21Zssz60lc6; Wed, 09 Jul 2025 17:53:02 +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 4bclv15lTvz3RsT; Wed, 09 Jul 2025 17:53:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752083581; 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=Uo5fqztSN2NAa2rsJrIKUOEh38u03pNxUNcpbhs++34=; b=NJpy7W9mQt1IpZoZP3qBGN2NH5UYlexg/+/Z5J3YWv3cVpNWzu1B050ouaQjWSqA4mdJ0k /zfOisFr63l81Kqh7/RpIXDy/zOeYt6I5OtXc0xueC8YzPXcznfamMiYQwr6VlUBQqDyd5 oC/zNa41zq+VTOEIiZNGswPZDjpJtMrmEZGLmhn+7XGz/7M1xl5JqR4b7eiqBsQeEN3q8W uTV1X7pLSM2AloIpHlYWXbwBpG3+GUBlpiRykYiThyngCJMNrezcA3np/BuJZy9YU8WRAM WnAcktjXkXvF8p9A29dSpCW0fj0IvpwyXpm0ZOE8Kbp8yCV7xKf1d09m4plQ/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752083581; 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=Uo5fqztSN2NAa2rsJrIKUOEh38u03pNxUNcpbhs++34=; b=hp7/Z53okVtGLg7q4nbZLmSQinocTeZrcS5mjivWZGldJGm00DmUkTAEhaGfdoGgxFm9Se cArKElS5RhD0EqBXNKFQmcBKL0JY2ewTbUo5ya4IDIQUCW8G925xw7Gwa+JqdTFmKh3EcJ jteeO2KHgaFogdQf5zaTC4v3pf8gVPlWzZlsq5ZJBl+V421MxFFOQMI6meMFyHBKY+I8U2 0BQ2NTY13ws8y/BUZc0ngLcVQ5Q9RG1v/TzT4xRRwojYLm9t/MthoywHl01Rf7DRvqLtXX vOUtxEIMvGUyCaxmYLoLH36eROYkUBkkDcSrCZ8OlzBHuk2i5lCjXfSIXGwe+g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752083581; a=rsa-sha256; cv=none; b=ccX9kGTJu6XlF1S223oyBjgRp6wdPeNBRFof9/sN78Tey9QfthNjaOXzaj9+RMKql2+efd DIg1U5P7LYRMfXIoWK7psMMcmBaqHF9ufejHmZwI2RfU1Y7KoAMCQ+7JNW6NPfvAvBGMF6 VCYb5TOa4qeY1RhAQoTxKD483S5HuHERSVw9oBsf6L57WuoM9W42g48QBshdi8xudOCTIA AFUKIh1VdYUKmpo1VTT+UUrJyyMcowTAleXscIJ6vX48IzWzj3WCqlRxCPLtg01iPnEp+T 941t2vJvgo6c+s+l/ceaymLkNZTSJUsqGCm8hB/Iht+Tgsg6R76+FPtktbyB4w== 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 4bclv15LwHzYxd; Wed, 09 Jul 2025 17:53:01 +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 569Hr172063690; Wed, 9 Jul 2025 17:53:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 569Hr1Yr063687; Wed, 9 Jul 2025 17:53:01 GMT (envelope-from git) Date: Wed, 9 Jul 2025 17:53:01 GMT Message-Id: <202507091753.569Hr1Yr063687@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Ziaee Subject: git: 91ad27bcfc49 - main - truncate.1: Polish title and examples List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 91ad27bcfc496393ba88f39ca13cdf1c59a7f487 Auto-Submitted: auto-generated The branch main has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=91ad27bcfc496393ba88f39ca13cdf1c59a7f487 commit 91ad27bcfc496393ba88f39ca13cdf1c59a7f487 Author: Alexander Ziaee AuthorDate: 2024-12-30 06:11:15 +0000 Commit: Alexander Ziaee CommitDate: 2025-07-09 17:52:01 +0000 truncate.1: Polish title and examples + describe better + switch examples to human readable sizes, with consistent spacing + `Downsize ... in 5 Megabytes` >> `Downsize ... by 5 Megabytes` + remove prompt from lone example with prompt for consistency + remove x permissions from kernel example + examples now fit on standard console without wrapping While here: + fold a line to eliminate linter warning + tag spdx + add -nosplit to AUTHORS to eliminate a rendering glitch MFC after: 3 days Discussed with: asomers, jhb, maxim Reviewed by: imp (previous version) Closes: https://github.com/freebsd/freebsd-src/pull/1568 --- usr.bin/truncate/truncate.1 | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/usr.bin/truncate/truncate.1 b/usr.bin/truncate/truncate.1 index f6b8b0cc37c9..aa70943b889f 100644 --- a/usr.bin/truncate/truncate.1 +++ b/usr.bin/truncate/truncate.1 @@ -1,4 +1,6 @@ .\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" Copyright (c) 2000 Sheldon Hearn . .\" All rights reserved. .\" Copyright (c) 2021 The FreeBSD Foundation @@ -27,12 +29,12 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd March 6, 2025 +.Dd July 9, 2025 .Dt TRUNCATE 1 .Os .Sh NAME .Nm truncate -.Nd truncate, extend the length of files, or perform space management in files +.Nd resize files or manage file space .Sh SYNOPSIS .Nm .Op Fl c @@ -132,7 +134,8 @@ file system space deallocation may be performed in the operation region. The space management operation is performed at the given .Ar offset bytes in the file. -If this option is not specified, the operation is performed at the beginning of the file. +If this option is not specified, +the operation is performed at the beginning of the file. .It Fl l Ar length The length of the operation range in bytes. This option must always be specified if option @@ -195,9 +198,9 @@ truncate -c -s 10M test_file .Pp Same as above but create the file if it does not exist: .Bd -literal -offset indent -truncate -s 10M test_file -ls -l test_file --rw-r--r-- 1 root wheel 10485760 Jul 22 18:48 test_file +truncate -s +10M test_file +ls -lh test_file +-rw-r--r-- 1 root wheel 10M Jul 22 18:48 test_file .Ed .Pp Adjust the size of @@ -207,10 +210,10 @@ to the size of the kernel and create another file 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 --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 +ls -lh /boot/kernel/kernel test_file* +-r--r--r-- 1 root wheel 30M May 15 14:18 /boot/kernel/kernel +-rw-r--r-- 1 root wheel 30M Jul 22 19:15 test_file +-rw-r--r-- 1 root wheel 30M Jul 22 19:15 test_file2 .Ed .Pp Increase the size of the file @@ -228,9 +231,9 @@ Reduce the size of the 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 +ls -lh test_file* +-rw-r--r-- 1 root wheel 25M Jul 22 19:17 test_file +-rw-r--r-- 1 root wheel 30M Jul 22 19:15 test_file2 .Ed .Sh SEE ALSO .Xr dd 1 , @@ -247,6 +250,7 @@ The utility first appeared in .Fx 4.2 . .Sh AUTHORS +.An -nosplit The .Nm utility was written by