Hadoop - 命令参考
“$ HADOOP_HOME / bin / hadoop fs”中有更多的命令比这里演示的更多,尽管这些基本的操作会让你开始。运行不带附加参数的./bin/hadoopdfs将列出可以使用FsShell系统运行的所有命令。此外, $ HADOOP_HOME / bin / hadoop fs -helpcommandName将显示相关操作的简短使用情况摘要,如果卡住了。
下面显示了所有操作的表格。以下约定用于参数:
- "<path>" means any file or directory name.
- "<path>..." means one or more file or directory names.
- "<file>" means any filename.
- "<src>" and "<dest>" are path names in a directed operation.
- "<localSrc>" and "<localDest>" are paths as above, but on the local file system.
所有其他文件和路径名称都是指HDFS内的对象。
1 | ls |
2 | lsr |
3 | du |
4 | dus <路径> 像-du一样,但会打印路径中所有文件/目录的磁盘使用情况摘要。 |
5 | mv |
6 | cp |
7 | rm |
8 | rmr <路径> 删除路径标识的文件或目录。递归删除任何子条目(即路径的文件或子目录)。 |
9 | put |
10 | copyFromLocal |
11 | moveFromLocal |
12 | get [-crc] |
13 | getmerge |
14 | cat |
15 | copyToLocal |
16 | moveToLocal |
17 | mkdir |
18 | setrep [-R] [-w] rep |
19 | touchz |
20 | test -[ezd] |
21 | stat [format] |
22 | tail [-f] |
23 | chmod [-R] mode,mode,… … |
24 | chown [-R] [owner][:[group]] … |
25 | chgrp [-R] group … |
26 | help |