truncate
Truncates all files that match the specified file pattern to the specified length.
The usage is as follows:
$ hadoop fs -truncate [-w] <length> <paths>
-w |
Waits for the block recovery to complete. |
Example:
$ hadoop fs -truncate 55 /user/hadoop/file1 /user/hadoop/file2
$ hadoop fs -truncate -w 127 hdfs://nn1.example.com/user/hadoop/file1