zoukankan      html  css  js  c++  java
  • hdfs的shell命令操作

    hadoop fs -help xx:查看xx命令的帮助

    hadoop fs -mkdir /hdfsPath:创建hdfs目录

    hadoop fs -mkdir -p /hdfsPath/hdfsPathChild:创建多级目录

    hadoop fs -put /localPath/file.txt /hdfsPath:将本地文件拷贝至hdfs目录

    hadoop fs -copyFromLocal /localPath/file.txt /hdfsPath:上传文件,等同于-put

    hadoop fs -cat /hdfsPath/file.txt:查看hdfs文件内容

    hadoop fs -tail /hdfsPath/file.txt:查看hdfs文件的末尾内容

    hadoop fs -rm /hdfsPath/file.txt:删除hdfs文件

    hadoop fs -get /hdfsPath/file.txt /localPath:将hdfs文件拷贝至本地

    hadoop fs -copyToLocal /hdfsPath/file.txt /localPath:下载文件,等同于-get

    hadoop fs -cp /hdfsPath1/file.txt /hdfsPath2:将hdfs文件从一个目录拷贝至另一个目录

    hadoop fs -mv /hdfsPath1/file.txt /hdfsPath2:将hdfs文件从一个目录移动至另一个目录

    hadoop fs -ls /hdfsPath:查看hdfs目录

    hadoop fs -ls -R /hdfsPath:递归查看hdfs目录

    hadoop fs -rmdir /hdfsPath:删除空目录

    hadoop fs -rm -r /hdfsPath:递归删除目录

    hadoop fs -appendToFile /localPath/file.txt /hdfsPath/file2.txt:将本地文件内容追加到hdfs目录文件中

    hadoop fs -chown userName:grpName /hdfsPath/file.txt:修改hdfs文件所有者及所在组

    hadoop fs -chgrp grpName /hdfsPath/file.txt:修改hdfs文件所在组

    hadoop fs -chmod 666 /hdfsPath/file.txt:修改hdfs文件权限

  • 相关阅读:
    未能加载文件或程序集BUG系列
    寄语
    65. Valid Number
    56. Merge Intervals
    sublime text3 anaconda 插件报错
    42. Trapping Rain Water
    windows 下win+r无效
    93. Restore IP Addresses
    32. Longest Valid Parentheses
    48 Rotate Image
  • 原文地址:https://www.cnblogs.com/wangmengdx/p/15087145.html
Copyright © 2011-2022 走看看