如何修改HDFS上的文件

如果只想append操作:

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

如果想modify操作,修改文件内容:

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

猜你喜欢

转载自blog.csdn.net/weixin_44388689/article/details/120783648