A. Common Hadoop commands
1. The FS command for Hadoop
#查看hadoop所有的fs命令
Hadoop FS
#上传文件 (both put and copyfromlocal are upload commands)
Hadoop fs-put jdk-7u55-linux-i586.tar.gz hdfs://hucc01:9000/jdkhadoop fs-copyfromlocal jdk-7u55-linux-i586.tar.gz Hdfs://hucc01:9000/jdk
#下载命令 (both get and copytolocal are download commands)
Hadoop fs-get hdfs://hucc01:9000/jdk jdk1.7hadoop fs-copytolocal hdfs://hucc01:9000/jdk jdk1.7
#将本地一个或者多个文件追加到hdfs文件中 (Appendtofile)
Hadoop fs-appendtofile Install.log/words
#查询hdfs的所有文件 (LS)
Hadoop Fs-ls/
#帮助命令 (Help)
Hadoop Fs-help FS
#查看hdfs文件的内容 (Cat and text)
Hadoop Fs-cat/wordshadoop Fs-text/words
#删除hdfs文件 (RM)
Hadoop fs-rm-r/words
#统计hdfs文件和文件夹的数量 (count)
Hadoop fs-count-r/
#合并hdfs某个文件夹的文件, and download to local (getmerge)
Hadoop Fs-getmerge/merge
#将本地文件剪切到hdfs, which is equivalent to uploading a local file and then deleting it (moveformlocal)
Hadoop fs-movefromlocal Words/
#查看当前文件系统的使用状态 (DF)
Hadoop FS-DF
Second, the commonly used HDFs command (this is used more)
Use the HDFs command, like the Hadoop command, after 2.0 recommendation
HDFs DFS
Second, summary
Nothing to learn, very easy, these commands are basically the same as the Linux command, as for some of the details of the use of the Help command on the line.
Refer to Hadoop-shell.pdf for details
This article is from the "Mo" blog, please be sure to keep this source http://flycc258.blog.51cto.com/8624126/1615120
Common shell commands for Hadoop