From nobody Fri Mar 07 01:48:39 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 4Z88MX4Nntz5qRV8; Fri, 07 Mar 2025 01:48:40 +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 4Z88MX0l91z3qXF; Fri, 07 Mar 2025 01:48:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741312120; 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=xjKnnW4sOuW/vA9HEqznlXlnJhste/vb9R5gRoIlwJA=; b=OjzQDVohlPnEKboicpA7EDs2QBWGd9OiiD+nP+HmtB3RkKL2HaeZWuDZ/W6/kDApoR5MoD QD0gsqbpM4uur32vQmT/1R7qrl/nt4ZlAZ8YpVaUcv2Rn6XnS5LEF8E0g1zqOPfyMWC79A OtVda2lnGh/g+1bKlbh7WmNxIlaW2owLgDeQOsJZ9J7zGrp76PaZ4JDg9rYGyVROwUUqHG /9RyeZCNUO8Am2VJj5eltNly9bZtHZfOhmL8tG6tXZtkMNI+grRnWZvdAFnOLOBY14Yv9F jSatOLuotM5wcfzKLH7LBP/iXlqTKIBUALoftjiKQjSjB+tKQyxnVj5nNE27vA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741312120; a=rsa-sha256; cv=none; b=CgBclpXN5yRjAq/RIy8eOjp72TrPd0AOoqT2cV4Sw0FvHpxmxkSY0GO5WdhD4Kgd3GQzDN cfWhuXswDDeMULm+qcYR2qAxPSJ1VFQB/yCypsl8+Sulda1mZIEjKX8ufLafADFUDSsk5n TQugrXNU8HesNsn/fMRjejiB1uZVcW6d6W7TEv3YtVo844Vvmb96CbUnY5wZWewXdilrab oPDvymu7MZGZ7BDwyYtJfJgwo5AiNfd9r+iOHiau9T6hxTxPwwfAG0+prwex/Ri9sgwKhT 3wDa4gDtyPAMACff5nIgknuM16MBMHI5XBl4llTWU9hjY6k6KfZiF5yINgg5Xg== 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=1741312120; 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=xjKnnW4sOuW/vA9HEqznlXlnJhste/vb9R5gRoIlwJA=; b=e8Tm2jr6YZu1+m0GCitlZpkcv5+ugPi17KBexDil+b891Iq91pIrgiBFk5Bhq/XXAlonU0 HQW65bvE+eJQ0pkItKhN+Ut0gyGi+0KllH3vgfTHe4XTW0Ar6XpC3XatpQlxv73BuzO7XM 0bHlLnwVHYSJ/9KIx5y9v/oo9rOjMCAWIS8BNhxIW0MS6gIGSoCLakw3QlDxnvi2EkK+8k IueYKTey/LNsuuLLGzEkQVgBnWwno3FcoN+g5zfMEFyDiyXqrC3EjatdHVRu2kpso6eUg4 x93zmpjhp1CtwlLCQdELM0LvTA/r7dl5mO6heJnCG8dKQPlzHCzUqoPnybtshg== 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 4Z88MW6rtFz1lZ; Fri, 07 Mar 2025 01:48:39 +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 5271mddC068571; Fri, 7 Mar 2025 01:48:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5271mdZe068568; Fri, 7 Mar 2025 01:48:39 GMT (envelope-from git) Date: Fri, 7 Mar 2025 01:48:39 GMT Message-Id: <202503070148.5271mdZe068568@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Maxim Konovalov Subject: git: 5460bdda9d4c - main - truncate.1: improve the example section 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: maxim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5460bdda9d4cb3ce1d7431824b6f53c545888b53 Auto-Submitted: auto-generated The branch main has been updated by maxim: URL: https://cgit.FreeBSD.org/src/commit/?id=5460bdda9d4cb3ce1d7431824b6f53c545888b53 commit 5460bdda9d4cb3ce1d7431824b6f53c545888b53 Author: Maxim Konovalov AuthorDate: 2025-03-07 01:45:21 +0000 Commit: Maxim Konovalov CommitDate: 2025-03-07 01:45:21 +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 --- 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