Hadoop 命令行最常用指令篇:
1.ls (list directory)
Usage:hadoop fs -ls [R]
Option: -R => 递归显示
2.mkdir (make directory)
Usage:hadoop fs -mkdir [-p]
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 URI
4.get(make directory)
Usage:hadoop fs -get URI
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)