From nobody Mon Jul 14 17:26:58 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 4bgq4g054Rz620hD; Mon, 14 Jul 2025 17:26:59 +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 4bgq4f5JTdz3XM9; Mon, 14 Jul 2025 17:26:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752514018; 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=pO5ymebQPh8NQgbo73E9ylFmBeZbFHBNTJNntjVVrPk=; b=oRbspMZyUkPBOJos9Tq8Hgnlxo/6DmO++dqK7s6Mv38gZ+cAB9HPKtsy/1zPvx/NNBRARe IE8mGUoHIm3bqWE5izG9PSTB6mfbPAqQCHCfv+jOFdURA8JjX0H/0uqb1oxA0Q5aaYW7lU 4sYopTeqS1mWs8u2VTkqqP1zIyppNAKqQi80ZN82lJKEwh6cBKo6Y4QXmHHwTgiJ4cc+zI L5QK30i3JO5XqQm+nCxVXHQ6pSoFVpoEN5O6CNX7Stfv+uz7jS83xJ0WvdX85FpQ05IN88 BoSSP2x7Nue3clMyK0Z6hVHp26LhKyu79WkL68OBjRSZkZtT9szb5mz1WSZ70g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752514018; 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=pO5ymebQPh8NQgbo73E9ylFmBeZbFHBNTJNntjVVrPk=; b=pPktDhgClemHz6tpA65IgcEV9umHOyuPcPDuKuK5TR1IbGrp7gcKfKeNa2aIxC6DIxTr9Q qBD+4Ky1ZmETIt41uLWU0nW9/uk3kDPAKy05x5AK8odszoNalZYV5TxhdNcNMWRIQKSBJP dXp9dCYf9JYHR0al2HUHs4Z4u39vTFtEuX7Z1+lFCOqZT+UGNSBIP9v3+nMzSCQ1ZBnFc5 Vil/51uSRjx7PQSUf72I6zyJ3UQopR9ROs+YqXqR+/eWFKyeLMinFnPsrKjqoqMl7emANm T5qSF5ViRADD/dDDIfAS61mCtE+zfh+UEmokschPLxBy9U8YS4etZ+xHkdzXMQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752514018; a=rsa-sha256; cv=none; b=PiIKbro1U9WqncGvGs3wcCuDc/zI9sgba9uiSjwLVWED4qSRWIJjkCaZy57GSsX6TpW5+J ukOJuz9kMhGwzxJpqQ1UIupsgDSkAE49t9ic5L0URpYKLHP1Q9JhcLoxispQWZ2xI8yMW4 7cmtsX0gWLeu11VffRdscb/ZLlGjYyLoTo2ixJZjImUrYT2RTOwTgTGdh4gofwm9Ou36E1 e8UnTEwj/Ku0QWhwKlOS/Ha14Qj60yPFFltua/ws71vuT/8Ov7U6K1p3Y0cU7DxGApTK2u aQ3Ih93zRRIqS08xAFsmwBEuHwOW/aieW6Y+nDd4sfvSSZwBR/i2B6S/V59Bzg== 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 4bgq4f4wM6z13fR; Mon, 14 Jul 2025 17:26:58 +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 56EHQwBY041127; Mon, 14 Jul 2025 17:26:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56EHQw4e041124; Mon, 14 Jul 2025 17:26:58 GMT (envelope-from git) Date: Mon, 14 Jul 2025 17:26:58 GMT Message-Id: <202507141726.56EHQw4e041124@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Ziaee Subject: git: 8c79b9db2bcc - stable/14 - truncate.1: Polish title and examples 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: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8c79b9db2bcc76bce8a1cd8e950bce806d70edcb Auto-Submitted: auto-generated The branch stable/14 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=8c79b9db2bcc76bce8a1cd8e950bce806d70edcb commit 8c79b9db2bcc76bce8a1cd8e950bce806d70edcb Author: Alexander Ziaee AuthorDate: 2024-12-30 06:11:15 +0000 Commit: Alexander Ziaee CommitDate: 2025-07-14 17:23:30 +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 (cherry picked from commit 91ad27bcfc496393ba88f39ca13cdf1c59a7f487) --- 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