Difference between revisions of "Truncate"

From wikieduonline
Jump to navigation Jump to search
Line 20: Line 20:
 
* <code>[[logrotate]]</code>
 
* <code>[[logrotate]]</code>
 
* <code>[[fallocate]]</code>
 
* <code>[[fallocate]]</code>
* [[tr]]
+
* <code>[[tr]]</code>
  
 
== See also ==
 
== See also ==

Revision as of 08:25, 9 February 2023

truncate (coreutils package)


  • Set file to zero:
    • truncate -s 0 /path/to/filename
    • truncate -s 0 /var/lib/docker/containers/*/*-json.log

Alternative: echo "" > filename


Related commands

See also

Advertising: