命令格式:
hadoop fs -command -option args

appendToFile
Usage: hadoop fs -appendToFile <localsrc> ... <dst>
退出状态:
0-成功
1-失败

$ hadoop fs -appendToFile 1130.txt hadoopfile
$ hadoop fs -appendToFile - hadoopfile   #从标准输入中读取数据,然后追加到hadoopfile文件末尾
$ hadoop fs -appendToFile test.c file.txt hadoopfile  #将test.c和file.txt文件内容追加到hadoopfile文件末尾

cat
Usage: hadoop fs -cat URI [URI ...]
退出状态:
0-成功
1-失败

$ hadoop fs -cat file:///home/hadoop/file.txt hadoopfile   #file:///就表示本地文件系统的/目录

checksum
Usage: hadoop fs -checksum URI

Returns the checksum information of a file.

Example:

hadoop fs -checksum hdfs://nn1.example.com/file1
hadoop fs -checksum file:///etc/hosts

ls
Usage: hadoop fs -ls [-d] [-h] [-R] <args>

Options:

-d: Directories are listed as plain files.
-h: Format file sizes in a human-readable fashion (eg 64.0m instead of 67108864).
-R: Recursively list subdirectories encountered.
For a file ls returns stat on the file with the following format:

permissions number_of_replicas userid groupid filesize modification_date modification_time filename

For a directory it returns list of its direct children as in Unix. A directory is listed as:

permissions userid groupid modification_date modification_time dirname

Files within a directory are order by filename by default.

Example:

hadoop fs -ls /user/hadoop/file1
Exit Code:

Returns 0 on success and -1 on error.

mkdir
Usage: hadoop fs -mkdir [-p] <paths>

Takes path uri’s as argument and creates directories.

Options:

The -p option behavior is much like Unix mkdir -p, creating parent directories along the path.
Example:

hadoop fs -mkdir /user/hadoop/dir1 /user/hadoop/dir2
hadoop fs -mkdir hdfs://nn1.example.com/user/hadoop/dir hdfs://nn2.example.com/user/hadoop/dir
Exit Code:

Returns 0 on success and -1 on error.

usage
Usage: hadoop fs -usage command

Return the help for an individual command.

Hadoop FS shell commands的更多相关文章

  1. 【转】Hadoop FS Shell命令

    FS Shell 调用文件系统(FS)Shell命令应使用 bin/hadoop fs <args> 的形式. 所有的的FS shell命令使用URI路径作为参数.URI格式是scheme ...

  2. Hadoop:hadoop fs、hadoop dfs与hdfs dfs命令的区别

    http://blog.csdn.net/pipisorry/article/details/51340838 'Hadoop DFS'和'Hadoop FS'的区别 While exploring ...

  3. hadoop fs –stat 命令

    当向HDFS上写文件时,可以通过设置dfs.blocksize配置项来设置文件的block size,这导致HDFS上不同文件的block size是不同的.有时候我们需要知道HDFS上某个文件的bl ...

  4. hadoop fs -stat 查看文件状态

    转载来自:https://blog.csdn.net/knowledgeaaa/article/details/24394287 当向HDFS上写文件时,可以通过设置dfs.block.size配置项 ...

  5. HDFS的基本shell操作,hadoop fs操作命令

    (1)分布式文件系统 随着数据量越来越多,在一个操作系统管辖的范围存不下了,那么就分配到更多的操作系统管理的磁盘中,但是不方便管理和维护,因此迫切需要一种系统来管理多台机器上的文件,这就是分布式文件管 ...

  6. FS Shell命令手册

    1.       FS Shell 1.1     简介 调用文件系统(FS)Shell命令应使用 bin/hadoop fs <args>的形式. 所有的的FS shell命令使用URI ...

  7. hadoop入门:hadoop使用shell命令总结

    第一部分:Hadoop Bin后面根据项目的实际需要Hadoop Bin  包括:Hadoop  hadoop的Shellhadoop-config.sh 它的作用是对一些变量进行赋值     HAD ...

  8. 何时使用hadoop fs、hadoop dfs与hdfs dfs命令(转)

    hadoop fs:使用面最广,可以操作任何文件系统. hadoop dfs与hdfs dfs:只能操作HDFS文件系统相关(包括与Local FS间的操作),前者已经Deprecated,一般使用后 ...

  9. 何时使用hadoop fs、hadoop dfs与hdfs dfs命令

    hadoop fs:使用面最广,可以操作任何文件系统. hadoop dfs与hdfs dfs:只能操作HDFS文件系统相关(包括与Local FS间的操作),前者已经Deprecated,一般使用后 ...

随机推荐

  1. Linux 性能优化之 IO 子系统

    本文介绍了对 Linux IO 子系统性能进行优化时需要考虑的因素,以及一些 IO 性能检测工具. 本文的大部分内容来自 IBM Redbook - Linux Performance and Tun ...

  2. VMWare虚拟机提供的桥接、nat和主机模式的区别

    虚拟机网络模式 无论是vmware,virtual box,virtual pc等虚拟机软件,一般来说,虚拟机有三种网络模式: 1.桥接 2.NAT 3.Host-Only 哪一种网络是适合自己的虚拟 ...

  3. Nginx 的编译安装和URL地址重写

    本文转自:http://www.178linux.com/14119#rd?sukey=ecafc0a7cc4a741b573a095a3eb78af6b4c9116b74d0bbc9844d8fc5 ...

  4. [转]NullPointerException异常

    原文地址:http://blog.csdn.net/javaeeteacher/article/details/4285488 顾名思义,NullPointerException是空指针异常.但是在J ...

  5. HTTP 405 错误 – 方法不被允许 (Method not allowed)

    HTTP 协议定义一些方法,以指明为获取客户端(如您的浏览器或我们的 CheckUpDown 机器人)所指定的具体网址资源而需要在 Web 服务器上执行的动作.则这些方法如下: 介绍 OPTIONS( ...

  6. js-格式化数字保留两位小数-带千分符

    很多时候发现有时候js会提示自带函数不能使用,所以自己找了很多资料实现了个 html <input type="text" class="input_text in ...

  7. sql-将查询字段拼接起来

    sql语句 select (a + b) as c mysql不起作用

  8. JavaScript的DOM操作-重点部分-第一部分

    Window.document 对象 一.找到元素 document.getElementById("id"); 根据id找,最多找一个: var a = document.get ...

  9. 绘图: Stroke, Brush

    Stroke - 笔划 Brush - 画笔 示例1.演示“Stroke”相关知识点Drawing/Stroke.xaml <Page x:Class="Windows10.Drawi ...

  10. js 刷新windows.open另一个窗口页面或window.open的页面如何刷新(父页面)上层页面

    一.js完整代码如下: //js打开新窗口 functionopenWin() {window.open('addInfo.jsp', '_blank','width=300,height=400,t ...