truncate
FilesAdvanced In simulator In real LinuxShrink or extend a file to a given size
Name: truncate
You can practise it right away in the simulator, and use it in real Linux mode too.
Description
truncate shrinks or extends a file to a given size. Shrinking discards data; extending fills with holes that take no disk space. truncate -s 0 empties a log that a program is still writing to, without deleting it.
Syntax
truncate OPTION... FILE...Common options
| -s / --size SIZE | Target size, e.g. 0, 10M, +1K |
| -c / --no-create | Do not create missing files |
| -r / --reference FILE | Make it as large as FILE |