hadoop hdfs基礎命令

2021-08-29 01:46:30 字數 1775 閱讀 8797

hadopp hdfs元件基礎命令

首行預設 hadoop fs

選項名稱

使用格式 含義

-ls-ls <

路徑》檢視指定路徑的當前目錄結構

-lsr

-lsr <

路徑》遞迴檢視指定路徑的目錄結構

-du-du <

路徑》統計目錄下個檔案大小

-dus

-dus <

路徑》匯**計目錄下檔案(夾

)大小-count

-count [-q] <

路徑》統計檔案(夾

)數量-mv

-mv <

源路徑》 <

目的路徑

> 移動

-cp-cp <

源路徑》 <

目的路徑

> 複製

-rm-rm [-skiptrash] <

路徑》刪除檔案

/空白資料夾

-rmr

-rmr [-skiptrash] <

路徑》遞迴刪除

-put

-put <

多個linux

上的檔案

> 路徑

>

上傳檔案

-copyfromlocal

-copyfromlocal <

多個linux

上的檔案

> 路徑

>

從本地複製

-movefromlocal

-movefromlocal <

多個linux

上的檔案

> 路徑

>

從本地移動

-getmerge

-getmerge <

源路徑》 路徑

>

合併到本地

-cat

-cat 路徑

>

檢視檔案內容

-text

-text 路徑

>

檢視檔案內容

-copytolocal

-copytolocal [-ignorecrc] [-crc] [hdfs

源路徑] [linux

目的路徑]

從本地複製

-movetolocal

-movetolocal [-crc] 源路徑

> 目的路徑

>

從本地移動

-mkdir

-mkdir 路徑

>

建立空白資料夾

-setrep

-setrep [-r] [-w] <

副本數》 <

路徑》修改副本數量

-touchz

-touchz <

檔案路徑

>

建立空白檔案

-stat

-stat [format] <

路徑》顯示檔案統計資訊

-tail

-tail [-f] <

檔案》檢視檔案尾部資訊

-chmod

-chmod [-r] <

許可權模式

> [路徑]

修改許可權

-chown

-chown [-r] [

屬主][:[

屬組]] 路徑

修改屬主

-chgrp

-chgrp [-r]

屬組名稱路徑

修改屬組

-help

-help [

命令選項]

幫助

Hadoop HDFS操作命令

1 檢視hadoop hdfs支援的所有命令hadoop fs2 列出目錄及檔案資訊hadoop fs ls3 迴圈列出目錄 子目錄及檔案資訊hadoop fs lsr4 將本地檔案系統的test.txt複製到hdfs檔案系統的 user sunlightcs目錄下hadoop fs put tes...

收藏 hadoop hdfs命令

cat 使用方法 hadoop fs cat uri uri 將路 徑指定檔案的內容輸出到stdout。示 例 hadoop fs cat hdfs host1 port1 file1 hdfs host2 port2 file2 hadoop fs cat file file3 user hado...

hadoop hdfs 命令大全

選項名稱 使用格式 含義 ls ls 路徑 檢視指定路徑的當前目錄結構 lsr lsr 路徑 遞迴檢視指定路徑的目錄結構 du du 路徑 統計目錄下個檔案大小 dus dus 路徑 匯 計目錄下檔案 夾 大小 count count q 路徑 統計檔案 夾 數量 mv mv 源路徑 目的路徑 移動...