- 查看
#查看文件信息
hdfs dfs -stat "%o %r" /mytest/1.txt- 上傳
#上傳一個文件
hdfs dfs -copyFromLocal /home/gc/1.txt /mytest/
#上傳本test.txt文件到HDFS根目錄,HDFS根目錄須無同名文件,否則「File exists」
hdfs fs -put file:/root/test.txt hdfs:/
#上傳並重命名文件
hdfs fs -put test.txt /test2.txt
#一次上傳多個文件到HDFS路徑
hdfs fs -put test1.txt test2.txt hdfs:/- 下載
#下載到本地
hdfs dfs -get /tmp/install.log /home/- 刪除
#刪除文件 刪除文件之後 文件被放入回收站trash
hdfs dfs -rm -r –skipTrash /mytest/1.txt
#跳過回收站
hdfs dfs -rm -r –skipTrash /mytest/1.txt- 數量
hdfs dfs -count /- 修改權限
hdfs dfs -chmod 777 /1.txt- 統計目錄各個文件大小
hdfs dfs -du -h /balance/*/*.zip- 多線程導入導出文件
| hdfs com.citicbank.hdfs.CrossFileSystemCopyer –r –t 5 file:///home/ hdfs://todo |
註:src多個逗號隔開,拷貝成功 命令返回0 失敗為1。
- Hadoop Native庫生效情況
hadoop checknative -a原創文章,作者:投稿專員,如若轉載,請註明出處:https://www.506064.com/zh-hk/n/210931.html
微信掃一掃
支付寶掃一掃