hdfs常用命令

2021-10-06 01:47:29 字數 1875 閱讀 1031

命令

使用方法

說明lshadoop fs -ls返回檔案詳細資訊或者目錄列表

lsrhadoop fs -lsr遞迴返回檔案詳細資訊或者目錄列表,類似ls -r

cathadoop fs -cat uri返回檔案內容

chgrphadoop fs -chgrp [-r] group uri改變檔案所屬組

chmodhadoop fs -chmod [-r]改變檔案的許可權

chownhadoop fs -chown [-r]改變檔案擁有者

puthadoop fs -put上傳檔案

copyfromlocalhadoop fs -copyfromlocal uri上傳檔案

movefromlocalhadoop fs -movefromlocal上傳檔案

gethadoop fs -get [-ignorecrc] [-crc]copytolocalhadoop fs -copytolocal [-ignorecrc] [-crc]cphadoop fs -cp uri複製檔案

duhadoop fs -du uri顯示所有檔案大小

dushadoop fs -dus顯示檔案大小

expungehadoop fs -expunge清空**站

getmergehadoop fs -getmerge [addnl]

mkdirhadoop fs -mkdir建立目錄

mvhadoop fs -mv uri移動

rmhadoop fs -rm uri刪除非空目錄和檔案

rmrhadoop fs -rmr遞迴刪除

setrephadoop fs -setrep [-r]改變檔案副本數

stathadoop fs -stat uri返回統計資訊

tailhadoop fs -tail [-f] uri返回檔案尾部1k位元組內容

testhadoop fs -test -[ezd] uri-e檢查檔案是否存在,-z檢查檔案是否為空,-d檢查檔案是否是目錄

texthadoop fs -text將檔案輸出和為文字格式,允許的格式ziptextrecordinputstream

touchzhadoop fs -touchz建立乙個空檔案

HDFS常用命令

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

HDFS常用命令

size medium hdfs 常用的檔案操作命令 1.cat 使用方法 hadoop fs cat uri 說明 將路徑指定的檔案輸出到螢幕 示例 hadoop fs cat hdfs host1 port1 file hadoop fs cat file file3 2.copyfromloc...

hdfs常用命令

hdfs檔案的相關操作主要使用hadoop fs hadoop dfs hdfs dfs 命令,以下對最常用的相關命令進行簡要說明。hadoop fs ls 顯示當前目錄結構,ls r 遞迴顯示目錄結構 hadoop fs mkdir 建立目錄 hadoop fs rm 刪除檔案,rm r 遞迴刪除...