命令格式:
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. Mybatis学习--spring和Mybatis整合

    简介 在前面写测试代码的时候,不管是基于原始dao还是Mapper接口开发都有许多的重复代码,将spring和mybatis整合可以减少这个重复代码,通过spring的模板方法模式,将这些重复的代码进 ...

  2. Node.js项目目录介绍

    新建的项目结构应该是这样 bin:项目的启动文件,也可以放其他脚本. node_modules:用来存放项目的依赖库. public:用来存放静态文件(css,js,img). routes:路由控制 ...

  3. Bitmap二次采样(处理图片过大的问题)

    private Bitmap createImageThumbnail(String filePath, int newHeight, int newWidth) { BitmapFactory.Op ...

  4. 【BZOJ 1455】罗马游戏

    左偏树模板 #include<cstdio> #include<cstring> #include<algorithm> using namespace std; ...

  5. NPOI导入,导出

    概述 NPOI 是 POI 项目的 .NET 版本.POI是一个开源的Java读写Excel.WORD等微软OLE2组件文档的项目.NPOI 可以在没有安装 Office 或者相应环境的机器上对 WO ...

  6. java-获取随机字符串

    import java.util.Random; public class getRandomString { public static String excute(int length) { St ...

  7. ThreadLocal详解(实现多线程同步访问变量)

    ThreadLocal翻译成中文比较准确的叫法应该是:线程局部变量. 这个玩意有什么用处,或者说为什么要有这么一个东东?先解释一下,在并发编程的时候,成员变量如果不做任何处理其实是线程不安全的,各个线 ...

  8. 普通用户安装 R 包

    转自 http://bnuzhutao.cn/archives/901 一般 R 语言的书籍上,介绍安装 R 包的方法都是这样的: install.packages("packagename ...

  9. 策略设计模式与c语言中的函数指针

    在C语言中有一个非常重要的概念-函数指针,其最重要的功能是实现回调函数(指函数先在某处注册,而它将在稍后某个需要的时候被调用)在java语言中没有指针的概念,但是可以利用接口和指针实现类似的功能,具体 ...

  10. wpf listview 换行

    <ListView  Name="listView1" VerticalAlignment="Top" Height="600" Ma ...