Difference between revisions of "Truncate"
Jump to navigation
Jump to search
Tags: Mobile web edit, Mobile edit |
|||
(5 intermediate revisions by the same user not shown) | |||
Line 3: | Line 3: | ||
− | + | Set file to zero: | |
− | + | * <code>truncate -s 0 /path/to/filename</code> | |
− | + | * <code>truncate -s 0 /var/lib/docker/containers/*/*-json.log</code> | |
− | + | * <code>[[echo]] "" > filename</code> | |
− | |||
+ | Truncate to a [[size]]: | ||
* <code>truncate -s 500MB [[/swap.img]]</code> | * <code>truncate -s 500MB [[/swap.img]]</code> | ||
Line 17: | Line 17: | ||
* <code>[[split]]</code> | * <code>[[split]]</code> | ||
* <code>[[rm]]</code> | * <code>[[rm]]</code> | ||
− | |||
* <code>[[logrotate]]</code> | * <code>[[logrotate]]</code> | ||
* <code>[[fallocate]]</code> | * <code>[[fallocate]]</code> | ||
Line 23: | Line 22: | ||
== See also == | == See also == | ||
− | * {{ | + | * {{coreutils}} |
* {{files}} | * {{files}} | ||
Latest revision as of 05:53, 16 March 2023
Advertising: