hdfs的shell命令
2016-07-09 09:32
579 查看
列出hdfs上的文件
hadoop fs -ls -R (递归查看) hdfs://ubuntu:9000/
可以简写为hadoop fs -ls /
查看hdfs文件内容
hadoop fs -cat /xx
从本地拷贝文件到hdfs
hadoop fs -copyFromLocal /root/xxx(linux上文件) /(hdfs的根)
同-put命令
从hdfs拷贝文件到本地
hadoop fs - copyToLocal ….
同-get命令
统计
hadoop -fs -count /
文件夹数 文件数 占用字节数
删除hdfs上文件
hadoop fs -rm
hdfs上的文件拷贝
hadoop fs -cp ……
新建文件夹
hadoop fs -mkdir ….
从本地剪切文件到hdfs
hadoop fs -moveFromLocal
从hdfs剪切文件到本地
hadoop fs -moveToLocal
查看文件的尾部
hadoop fs -tail -f …..
改变权限
hadoop fs -chmod -R -x /out 删除out及其下面文件的x权限
改变所有者
hadoop fs -chown supergroup /file.txt 改变file.txt的所有者为supergroup
改变组
hadoop fs -chgrp group /file.txt
同时改变用户和组
hadoop fs -chown owner:group /file.txt
hadoop fs -ls -R (递归查看) hdfs://ubuntu:9000/
可以简写为hadoop fs -ls /
查看hdfs文件内容
hadoop fs -cat /xx
从本地拷贝文件到hdfs
hadoop fs -copyFromLocal /root/xxx(linux上文件) /(hdfs的根)
同-put命令
从hdfs拷贝文件到本地
hadoop fs - copyToLocal ….
同-get命令
统计
hadoop -fs -count /
文件夹数 文件数 占用字节数
删除hdfs上文件
hadoop fs -rm
hdfs上的文件拷贝
hadoop fs -cp ……
新建文件夹
hadoop fs -mkdir ….
从本地剪切文件到hdfs
hadoop fs -moveFromLocal
从hdfs剪切文件到本地
hadoop fs -moveToLocal
查看文件的尾部
hadoop fs -tail -f …..
改变权限
hadoop fs -chmod -R -x /out 删除out及其下面文件的x权限
改变所有者
hadoop fs -chown supergroup /file.txt 改变file.txt的所有者为supergroup
改变组
hadoop fs -chgrp group /file.txt
同时改变用户和组
hadoop fs -chown owner:group /file.txt
相关文章推荐
- PAC Manager Linux下类似SecureCRT Xshell的SSH工具
- Windows Remote Shell(WinRM)使用介绍
- bash shock vulnerable
- 用spark(spark-shell),从本地文件创建一个RDD
- Jenkins+SVN+Maven+Shell 实现项目一键发布
- git bash for windows
- shell编程:递归遍历目录下的所有文件并统一改名
- shell学习网址
- shell-init: error
- shell脚本(正则表达+sed+awk)
- shell 检查是否是root用户
- Xshell5中常用linux服务器命令集合
- shell 学习心得之awk篇
- linux shell中怎样批量修改文件名为 文件夹_文件名
- linux shell java jar 使用依赖包时classpath的设置问题
- linux批量替换文件内容3种方法(perl,sed,shell)
- Shell脚本编程之结构化命令
- -bash: xxx: /bin/sh^M: bad interpreter: No such file or directory
- shell脚本变量$#,$*,$$,$@,$0,$1,$2,$?的含义
- linux切换用户提示bash-4.1$