Hadoop 命令行最常用指令篇:
1.ls (list directory)
Usage:hadoop fs -ls [R]
Option: -R => 递归显示
2.mkdir (make directory)
Usage:hadoop fs -mkdir [-p] <paths>
Takes path uri's as argument and creates directories.
Options: -p make parent file => 当给的路径含有不存在的父目录时,递归创建目录
3.put (put local files to hdfs)
Usage:hadoop fs -put <localsrc> URI
4.get(make directory)
Usage:hadoop fs -get URI<localsrc>
4.rm(remove directory or file)
Usage:hadoop fs -rm [-f] [-r |-R] URI [URI ...]
Options:
-f => force 强制删除,不给提示。-r |-R => recursively 递归删除所有目录中的文件。
Warning: hadoop fs -rm "-rf" 不能连在一起写,需要一个个给出:hadoop fs -rm-r -f
4.mv(move directory or file)
Usage:hadoop fs -mv URI [URI ...] <dest>
Feature:支持多个目录或文件移动
总结
以上所述是小编给大家介绍的Hadoop 文件系统命令行基础,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对阿兔在线工具网站的支持!
如果你觉得本文对你有帮助,欢迎转载,烦请注明出处,谢谢!