当前位置:首页 > 大数据 > 正文内容

hadoop fs –truncate 截断与指定长度匹配指定文件模式的所有文件

2019-09-05 | 分类:大数据 | 评论:0人 | 浏览:31次

 

truncate: Invalid value for webhdfs parameter "op": No enum constant org.apache.hadoop.hdfs.web.resources.PostOpParam.Op.TRUNCATE

Truncate all files that match the specified file pattern to the specified length.

 

 

Usage: hadoop fs -truncate [-w] <length> <paths>

Truncate all files that match the specified file pattern to the specified length.

Options:

  • The -w flag requests that the command waits for block recovery to complete, if necessary. Without -w flag the file may remain unclosed for some time while the recovery is in progress. During this time file cannot be reopened for append.

Example:

  • hadoop fs -truncate 55 /user/hadoop/file1 /user/hadoop/file2
  • hadoop fs -truncate -w 127 hdfs://nn1.example.com/user/hadoop/file1
来源:赵大虾博客(微信号/QQ号:),转载请注明出处,谢谢!

  • 评论:(0)

已有 0 位网友发表了一针见血的评论,你还等什么?

◎欢迎参与讨论!

傲笑九天志在必得, 卧薪尝胆勇者无畏

站内搜索

傲笑九天志在必得, 卧薪尝胆勇者无畏

傲笑九天志在必得, 卧薪尝胆勇者无畏