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 => 當(dāng)給的路徑含有不存在的父目錄時(shí),遞歸創(chuàng)建目錄
3.put (put local files to hdfs)
Usage:hadoop fs -put localsrc> URI
4.get(make directory)
Usage:hadoop fs -get URIlocalsrc>
4.rm(remove directory or file)
Usage:hadoop fs -rm [-f] [-r |-R] URI [URI ...]
Options:
-f => force 強(qiáng)制刪除,不給提示。-r |-R => recursively 遞歸刪除所有目錄中的文件?! ?/p>
Warning: hadoop fs -rm "-rf" 不能連在一起寫,需要一個(gè)個(gè)給出:hadoop fs -rm-r -f
4.mv(move directory or file)
Usage:hadoop fs -mv URI [URI ...] dest>
Feature:支持多個(gè)目錄或文件移動(dòng)
總結(jié)
以上所述是小編給大家介紹的Hadoop 文件系統(tǒng)命令行基礎(chǔ),希望對(duì)大家有所幫助,如果大家有任何疑問(wèn)請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)腳本之家網(wǎng)站的支持!
如果你覺(jué)得本文對(duì)你有幫助,歡迎轉(zhuǎn)載,煩請(qǐng)注明出處,謝謝!
您可能感興趣的文章:- Java訪問(wèn)Hadoop分布式文件系統(tǒng)HDFS的配置說(shuō)明