How do I truncate a file?

How do I truncate a file?
Answer
The easiest and most used method to truncate files is to
use the > shell redirection operator.
…
Shell Redirection
  1. The : colon means true and produces no output.
  2. The redirection operator > redirect the output of the preceding command to the given file.
  3. filename , the file you want to truncate.
 

Tìm kiếm

Back
Top