Usage: hadoop fs [generic options]
[-appendToFile <localsrc> ... <dst>]
[-cat [-ignoreCrc] <src> ...]
[-checksum <src> ...]
[-chgrp [-R] GROUP PATH...]
[-chmod [-R] <MODE[,MODE]... | OCTALMODE> PATH...]
[-chown [-R] [OWNER][:[GROUP]] PATH...]
[-copyFromLocal [-f] [-p] <localsrc> ... <dst>]
[-copyToLocal [-p] [-ignoreCrc] [-crc] <src> ... <localdst>]
[-count [-q] <path> ...]
[-cp [-f] [-p] <src> ... <dst>]
[-createSnapshot <snapshotDir> [<snapshotName>]]
[-deleteSnapshot <snapshotDir> <snapshotName>]
[-df [-h] [<path> ...]]
[-du [-s] [-h] <path> ...]
[-expunge]
[-get [-p] [-ignoreCrc] [-crc] <src> ... <localdst>]
[-getmerge [-nl] <src> <localdst>]
[-help [cmd ...]]
[-ls [-d] [-h] [-R] [<path> ...]]
[-mkdir [-p] <path> ...]
[-moveFromLocal <localsrc> ... <dst>]
[-moveToLocal <src> <localdst>]
[-mv <src> ... <dst>]
[-put [-f] [-p] <localsrc> ... <dst>]
[-renameSnapshot <snapshotDir> <oldName> <newName>]
[-rm [-f] [-r|-R] [-skipTrash] <src> ...]
[-rmdir [--ignore-fail-on-non-empty] <dir> ...]
[-setrep [-R] [-w] <rep> <path> ...]
[-stat [format] <path> ...]
[-tail [-f] <file>]
[-test -[defsz] <path>]
[-text [-ignoreCrc] <src> ...]
[-touchz <path> ...]
[-usage [cmd ...]]
1.hdfs dfs -hrlp 查看帮助
[root@yufan C000008]# hdfs dfs -help
2.hdfs dfs -mkdir 创建一个文件夹
[root@yufan C000008]# hdfs dfs -mkdir /test
3.hdfs dfs -put 将本地文件上传到hdfs中
[root@yufan C000008]# hdfs dfs -put 10.txt /test/
4.hdfs dfs -ls 列出路径下的所有文件和文件夹
[root@yufan C000008]# hdfs dfs -ls /test/
[root@yufan C000008]# hdfs dfs -cat /test/10.txt
[root@yufan C000008]# hdfs dfs -text /test/10.txt
[root@yufan C000008]# hdfs dfs -touchz /textFile
[root@yufan C000008]# hdfs dfs -ls -R /
9.hdfs dfs -mv A B 将文件从A 移动到 B
[root@yufan C000008]# hdfs dfs -mv /test/10.txt /test
[root@yufan C000008]# hdfs dfs -cp /test/10.txt /
[root@yufan C000008]# hdfs dfs -moveFromLocal /home/bigdata/eclipse/testFile/Reduced/C000008/100.txt /test
12.hdfs dfs -rm 删除文件
[root@yufan C000008]# hdfs dfs -rm /test/100.txt
13.hdfs dfs -rmdir 删除文件夹
hdfs dfs -rmdir /test/testDir
14.hdfs dfs -get 将文件从hdfs系统移动到本地
[root@yufan C000008]# hdfs dfs -get /test/testFile /home/