Hadoop FS shell commands
命令格式:
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的更多相关文章
- 【转】Hadoop FS Shell命令
FS Shell 调用文件系统(FS)Shell命令应使用 bin/hadoop fs <args> 的形式. 所有的的FS shell命令使用URI路径作为参数.URI格式是scheme ...
- Hadoop:hadoop fs、hadoop dfs与hdfs dfs命令的区别
http://blog.csdn.net/pipisorry/article/details/51340838 'Hadoop DFS'和'Hadoop FS'的区别 While exploring ...
- hadoop fs –stat 命令
当向HDFS上写文件时,可以通过设置dfs.blocksize配置项来设置文件的block size,这导致HDFS上不同文件的block size是不同的.有时候我们需要知道HDFS上某个文件的bl ...
- hadoop fs -stat 查看文件状态
转载来自:https://blog.csdn.net/knowledgeaaa/article/details/24394287 当向HDFS上写文件时,可以通过设置dfs.block.size配置项 ...
- HDFS的基本shell操作,hadoop fs操作命令
(1)分布式文件系统 随着数据量越来越多,在一个操作系统管辖的范围存不下了,那么就分配到更多的操作系统管理的磁盘中,但是不方便管理和维护,因此迫切需要一种系统来管理多台机器上的文件,这就是分布式文件管 ...
- FS Shell命令手册
1. FS Shell 1.1 简介 调用文件系统(FS)Shell命令应使用 bin/hadoop fs <args>的形式. 所有的的FS shell命令使用URI ...
- hadoop入门:hadoop使用shell命令总结
第一部分:Hadoop Bin后面根据项目的实际需要Hadoop Bin 包括:Hadoop hadoop的Shellhadoop-config.sh 它的作用是对一些变量进行赋值 HAD ...
- 何时使用hadoop fs、hadoop dfs与hdfs dfs命令(转)
hadoop fs:使用面最广,可以操作任何文件系统. hadoop dfs与hdfs dfs:只能操作HDFS文件系统相关(包括与Local FS间的操作),前者已经Deprecated,一般使用后 ...
- 何时使用hadoop fs、hadoop dfs与hdfs dfs命令
hadoop fs:使用面最广,可以操作任何文件系统. hadoop dfs与hdfs dfs:只能操作HDFS文件系统相关(包括与Local FS间的操作),前者已经Deprecated,一般使用后 ...
随机推荐
- MyBatis学习--SqlMapConfig.xml配置文件
简介 SqlMapConfig.xml是MyBatis的全局配置文件,在前面的文章中我们可以看出,在SqlMapConfig.xml主要是配置了数据源.事务和映射文件,其实在SqlMapConfig. ...
- Java追加文件内容的三种方法
import java.io.BufferedWriter; import java.io.File; import java.io.FileOutputStream; import java.io. ...
- 【USACO 2.1】Sorting A Three-Valued Sequence
/* TASK: sort3 LANG: C++ URL: http://train.usaco.org/usacoprob2?a=RkPIMxsFWzm&S=sort3 SOLVE: n个数 ...
- bzoj4409&&bzoj4410&&bzoj4411[Usaco2016 Feb Platinum]题解
辣鸡wyz最近状态奇差,于是想用usaco题找找手感,万万没想到被虐了一脸TAT 先贴代码,有空再填坑 4409[Usaco2016 Feb]Circular barn #include <io ...
- awk 匹配不是 pattern 的内容
awk '/pattern/ {next} {print $0}' filename
- iOS随机生成数字
有时候我们需要在程序中生成随机数,但是在Objective-c中并没有提供相应的函数,好在C中提供了rand().srand().random().arc4random()几个函数.那么怎么使用呢?下 ...
- 【caffe】create_cifar10.sh在windows下解决方案
@tags caffe python windows下配置caffe后,create_cifar10.sh无法执行,因为是shell脚本.那就看懂脚本意思,用python重写一个: # create_ ...
- Jenkins 2.x版本的节点配置选项更新
[Dumb slave]改成了[Permanent Agent],效果一致 参考:http://serverfault.com/questions/793619/jenkins-trying-to-a ...
- AutoIt3(AU3)开发的装机小工具,实现快速检测以及一些重用快捷操作功能
项目相关地址 源码:https://github.com/easonjim/Installed_Tools bug提交:https://github.com/easonjim/Installed_To ...
- bzoj1535[POI2005]sza-template
此题解无病呻吟,啰里啰嗦,现已加入零分作文全家桶 这题......坑死我了...... 不妨记原串长为i的前缀为prefix(i),next[i]表示prefix(i)的最长公共前后缀长度(不等于pr ...