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

  • 相关阅读:
    MooseFS基础和安装
    自动化运维工具SaltStack详细部署
    linux中的通配符与正则表达式
    使用GitHub做个人博客
    mysql数据库分库备份脚本
    php-fpm配置详解
    php-fpm安装、配置与优化
    ceph的正常卸载与非正常卸载
    CentOS系统/tmp目录里面的文件默认保留多久
    ansible常用命令
  • 原文地址:https://www.cnblogs.com/wangmengdx/p/15087145.html
Copyright © 2011-2022 走看看