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文件权限

  • 相关阅读:
    类和接口的区别
    ref 和out的区别
    重载 重写 多态区别
    UML种类与类的关系
    Window.open() 全攻略
    C#委托
    RT Diagnostics Routines
    tar.bz2 解压命令。
    教你10招最有效防电脑辐射方法
    预处理,编译, 优化, 汇编, 链接
  • 原文地址:https://www.cnblogs.com/wangmengdx/p/15087145.html
Copyright © 2011-2022 走看看