如何修改HDFS上文件

如果只想append操作:

1. echo "<Text to append>" | hdfs dfs -appendToFile - yourHdfsPath/test.txt 

如果想modify操作:

1 hdfs dfs -get yourHdfsPath/test.txt
2 vi test.txt #or use any other tool and modify it
3 hdfs dfs -put -f test.txt yourHdfsPath/test.txt

 

posted @ 2017-03-22 14:26  银雪飞马  阅读(8645)  评论(0编辑  收藏  举报