-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
truncate.1: Minor polish #1568
Open
concussious
wants to merge
2
commits into
freebsd:main
Choose a base branch
from
concussious:truncate.1
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
truncate.1: Minor polish #1568
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
.\" | ||
.\" SPDX-License-Identifier: BSD-2-Clause | ||
.\" | ||
.\" Copyright (c) 2000 Sheldon Hearn <sheldonh@FreeBSD.org>. | ||
.\" 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 August 19, 2021 | ||
.Dd December 30, 2024 | ||
.Dt TRUNCATE 1 | ||
.Os | ||
.Sh NAME | ||
.Nm truncate | ||
.Nd truncate, extend the length of files, or perform space management in files | ||
.Nd resize, extend, or perform space management in files | ||
.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 | ||
|
@@ -196,8 +199,8 @@ truncate -c -s +10M test_file | |
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 | ||
ls -lh test_file | ||
-rw-r--r-- 1 root wheel 10M Jul 22 18:48 test_file | ||
.Ed | ||
.Pp | ||
Adjust the size of | ||
|
@@ -207,20 +210,20 @@ 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* | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
-r-xr-xr-x 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 | ||
Downsize | ||
.Pa test_file | ||
in 5 Megabytes: | ||
by 5 Megabytes: | ||
.Bd -literal -offset indent | ||
# 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 31352552 Jul 22 19:15 test_file2 | ||
truncate -s -5M test_file | ||
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 , | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"truncate" and "extend" are opposites. But "extend" operations are a subset of "resize". I like the old wording better. If you're going to switch to "resize", you should eliminate "extend".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Is extend a reasonable search keyword? If we're willing to drop them, how's
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I probably also prefer the older text, but the old text is also kind of buggy, it should be more like:
Alternatively I think what Alan was suggesting might be:
"manage backing store for files" might be a more accurate description, but "manage disk space for files" is pretty close to that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow,
manage backing store for files
is absolutely the best one and tells me everything without creating any false ideas!There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Defenso-QTH suggested on discord
resize files
.