zoukankan      html  css  js  c++  java
  • hdfs 常用命令

    hdfs基本操作
    1、查询命令
      hadoop dfs -ls / 查询/目录下的所有文件和文件夹

      hadoop dfs -ls -R 以递归的方式查询/目录下的所有文件

    2、创建文件夹
      hadoop dfs -mkdir /test 创建test文件夹

    3、创建新的空文件
      hadoop dfs -touchz /aa.txt 在/目录下创建一个空文件aa.txt

    4、增加文件
      hadoop dfs -put aa.txt /test 将当前目录下的aa.txt文件复制到/test目录下(把-put换成-copyFromLocal效果一样-moveFromLocal会移除本地文件)

    5、查看文件内容
      hadoop dfs -cat /test/aa.txt 查看/test目录下文件aa.txt的内容(将-cat 换成-text效果一样)

    6、复制文件
      hadoop dfs -copyToLocal /test/aa.txt . 将/test/aa.txt文件复制到当前目录(.是指当前目录,也可指定其他的目录)

    7、删除文件或文件夹
      hadoop dfs -rm -r /test/aa.txt 删除/test/aa.txt文件(/test/aa.txt可以替换成文件夹就是删除文件夹)

    8、重命名文件
      hadoop dfs -mv /aa.txt /bb.txt 将/aa.txt文件重命名为/bb.txt

    9、将源目录中的所有文件排序合并到一个本地文件
      hadoop dfs -getmerge / local-file 将/目录下的所有文件合并到本地文件local-file中

  • 相关阅读:
    VS2010 自动跳过代码现象
    Reverse Linked List II 【纠结逆序!!!】
    Intersection of Two Linked Lists
    Linked List Cycle II
    Remove Nth Node From End of List 【另一个技巧,指针的指针】
    Swap Nodes in Pairs
    Merge Two Sorted Lists
    Remove Duplicates from Sorted List
    Linked List Cycle
    Dungeon Game
  • 原文地址:https://www.cnblogs.com/YuanWeiBlogger/p/11970126.html
Copyright © 2011-2022 走看看