好程序員大數據教程分享HadoopHDFS操做命令總結程序員
1.列出根目錄下全部的目錄或文件windows
hadoopfs-ls/app
2.列出/logs目錄下的全部目錄和文件oop
hadoopfs-ls/logs大數據
3.列出/user目錄及其子目錄下的全部文件(謹慎使用)教程
hadoopfs-ls-R/userhadoop
4.建立/soft目錄input
hadoopfs-mkdir/soft文件上傳
5.建立多級目錄集羣
hadoopfs-mkdir-p/apps/windows/2017/01/01
6.將本地的wordcount.jar文件上傳到/wordcount目錄下
hadoopfs-putwordcount.jar/wordcount
7.將/stu/students.txt文件拷貝到本地
hadoopfs-copyToLocal/stu/students.txt
8.將word.txt文件拷貝到/wordcount/input/目錄
hadoopfs-copyFromLocalword.txt/wordcount/input
9.將word.txt文件從本地移動到/wordcount/input/目錄下
hadoopfs-moveFromLocalword.txt/wordcount/input/
10.將/stu/students.txt拷貝一份爲/stu/students.txt.bak
hadoopfs-cp/stu/students.txt/stu/students.txt.bak
11.將/flume/tailout/目錄下的子目錄或文件都拷貝到/logs目錄(若是此目錄不存在會建立)下
hadoopfs-cp/flume/tailout//logs
12.將/word.txt文件重命名爲/words.txt
hadoopfs-mv/word.txt/words.txt
13.將/words.txt文件移動到/wordcount/input/目錄下
hadoopfs-mv/words.txt/wordcount/input/
14.將/ws目錄以及子目錄和文件都刪除(謹慎使用)
hadoopfs-rm-r/ws
15.將/wordcount/output2/目錄下的a.txt文件刪除
hadoopfs-rm/wordcount/output2/a.txt
16.將/wordcount/input/目錄下面的全部文件都刪除
hadoopfs-rm/wordcount/input/*
17.查看HDFS集羣的磁盤空間使用狀況
hadoopfs-df-h
18.查看/word.txt文件的內容
hadoopfs-cat/word.txt
19.將name.txt文件中的內容添加到/wordcount/input/words.txt文件中
hadoopfs-appendToFilename.txt/wordcount/words.txt
20.動態查看/wordcount/input/words.txt文件的內容
hadoopfs-tail-f/wordcount/words.txt
21.統計/flume目錄總大小
hadoopfs-du-s-h/flume
22.分別統計/flume目錄下各個子目錄(或文件)大小
hadoopfs-du-s-h/flume/*