Lines 27-33
Link Here
|
27 |
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
27 |
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
28 |
.\" SUCH DAMAGE. |
28 |
.\" SUCH DAMAGE. |
29 |
.\" |
29 |
.\" |
30 |
.Dd August 19, 2021 |
30 |
.Dd February 28, 2025 |
31 |
.Dt TRUNCATE 1 |
31 |
.Dt TRUNCATE 1 |
32 |
.Os |
32 |
.Os |
33 |
.Sh NAME |
33 |
.Sh NAME |
Lines 188-201
and continue processing the remaining arguments.
Link Here
|
188 |
.Sh EXAMPLES |
188 |
.Sh EXAMPLES |
189 |
Adjust the size of the file |
189 |
Adjust the size of the file |
190 |
.Pa test_file |
190 |
.Pa test_file |
191 |
to 10 Megabytes but do not create it if it does not exist: |
191 |
to 10 megabytes but do not create it if it does not exist: |
192 |
.Bd -literal -offset indent |
192 |
.Bd -literal -offset indent |
193 |
truncate -c -s +10M test_file |
193 |
truncate -c -s 10M test_file |
194 |
.Ed |
194 |
.Ed |
195 |
.Pp |
195 |
.Pp |
196 |
Same as above but create the file if it does not exist: |
196 |
Same as above but create the file if it does not exist: |
197 |
.Bd -literal -offset indent |
197 |
.Bd -literal -offset indent |
198 |
truncate -s +10M test_file |
198 |
truncate -s 10M test_file |
199 |
ls -l test_file |
199 |
ls -l test_file |
200 |
-rw-r--r-- 1 root wheel 10485760 Jul 22 18:48 test_file |
200 |
-rw-r--r-- 1 root wheel 10485760 Jul 22 18:48 test_file |
201 |
.Ed |
201 |
.Ed |
Lines 208-225
with the same size:
Link Here
|
208 |
.Bd -literal -offset indent |
208 |
.Bd -literal -offset indent |
209 |
truncate -r /boot/kernel/kernel test_file test_file2 |
209 |
truncate -r /boot/kernel/kernel test_file test_file2 |
210 |
ls -l /boot/kernel/kernel test_file* |
210 |
ls -l /boot/kernel/kernel test_file* |
211 |
-r-xr-xr-x 1 root wheel 31352552 May 15 14:18 /boot/kernel/kernel* |
211 |
-r-xr-xr-x 1 root wheel 31352552 May 15 14:18 /boot/kernel/kernel |
212 |
-rw-r--r-- 1 root wheel 31352552 Jul 22 19:15 test_file |
212 |
-rw-r--r-- 1 root wheel 31352552 Jul 22 19:15 test_file |
213 |
-rw-r--r-- 1 root wheel 31352552 Jul 22 19:15 test_file2 |
213 |
-rw-r--r-- 1 root wheel 31352552 Jul 22 19:15 test_file2 |
214 |
.Ed |
214 |
.Ed |
215 |
.Pp |
215 |
.Pp |
216 |
Downsize |
216 |
Increase the size of the file |
217 |
.Pa test_file |
217 |
.Pa test_file |
218 |
in 5 Megabytes: |
218 |
by 5 megabytes but do not create it if it does not exist: |
219 |
.Bd -literal -offset indent |
219 |
.Bd -literal -offset indent |
220 |
# truncate -s -5M test_file |
220 |
truncate -s +5M test_file |
221 |
ls -l test_file* |
221 |
ls -l test_file* |
222 |
-rw-r--r-- 1 root wheel 26109672 Jul 22 19:17 test_file |
222 |
-rw-r--r-- 1 root wheel 36595432 Sep 20 19:17 test_file |
|
|
223 |
-rw-r--r-- 1 root wheel 31352552 Sep 20 19:15 test_file2 |
224 |
.Ed |
225 |
.Pp |
226 |
Reduce the size of the file |
227 |
.Pa test_file |
228 |
by 5 megabytes: |
229 |
.Bd -literal -offset indent |
230 |
truncate -s -5M test_file |
231 |
ls -l test_file* |
232 |
-rw-r--r-- 1 root wheel 31352552 Jul 22 19:19 test_file |
223 |
-rw-r--r-- 1 root wheel 31352552 Jul 22 19:15 test_file2 |
233 |
-rw-r--r-- 1 root wheel 31352552 Jul 22 19:15 test_file2 |
224 |
.Ed |
234 |
.Ed |
225 |
.Sh SEE ALSO |
235 |
.Sh SEE ALSO |