git: 6207ca7b76b0 - stable/14 - truncate.1: improve the example section
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 14 Mar 2025 01:57:13 UTC
The branch stable/14 has been updated by maxim: URL: https://cgit.FreeBSD.org/src/commit/?id=6207ca7b76b0410ed95d82d6d85ee60fe3138998 commit 6207ca7b76b0410ed95d82d6d85ee60fe3138998 Author: Maxim Konovalov <maxim@FreeBSD.org> AuthorDate: 2025-03-07 01:45:21 +0000 Commit: Maxim Konovalov <maxim@FreeBSD.org> 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