Hadoop 命令行最常用指令篇: 1.ls (list directory) Usage: hadoop fs -ls [R] Option: -R => 遞歸顯示 2.mkdir (make directory) Usage: hadoop fs -mkdir [-p] <paths> Take ...
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: 支持多個目錄或文件移動