bin/hadoop fs 具体命令
bin/hadoop fs
[-appendToFile ... ]
[-cat [-ignoreCrc] ...]
[-checksum ...]
[-chgrp [-R] GROUP PATH...]
[-chmod [-R] PATH...]
[-chown [-R] [OWNER][:[GROUP]] PATH...]
[-copyFromLocal [-f] [-p] ... ]
[-copyToLocal [-p] [-ignoreCrc] [-crc] ... ]
[-count [-q] ...]
[-cp [-f] [-p] ... ]
[-createSnapshot []]
[-deleteSnapshot ]
[-df [-h] [ ...]]
[-du [-s] [-h] ...]
[-expunge]
[-get [-p] [-ignoreCrc] [-crc] ... ]
[-getfacl [-R] ]
[-getmerge [-nl] ]
[-help [cmd ...]]
[-ls [-d] [-h] [-R] [ ...]]
[-mkdir [-p] ...]
[-moveFromLocal ... ]
[-moveToLocal ]
[-mv ... ]
[-put [-f] [-p] ... ]
[-renameSnapshot ]
[-rm [-f] [-r|-R] [-skipTrash] ...]
[-rmdir [--ignore-fail-on-non-empty] ...]
[-setfacl [-R] [{-b|-k} {-m|-x } ]|[--set ]]
[-setrep [-R] [-w] ...]
[-stat [format] ...]
[-tail [-f] ]
[-test -[defsz] ]
[-text [-ignoreCrc] ...]
[-touchz ...]
[-usage [cmd ...]]
bin/hdfs dfs -help rm
hadoop fs -ls /
hadoop fs -mkdir -p /aaa/bbb/cc/dd
hadoop fs - moveFromLocal /home/hadoop/a.txt /aaa/bbb/cc/dd
hadoop fs - moveToLocal /aaa/bbb/cc/dd /home/hadoop/a.txt
hadoop fs -appendToFile ./hello.txt /hello.txt
hadoop fs -tail /weblog/access_log.1
hadoop fs -text /weblog/access_log.1
hadoop fs -chmod 666 /hello.txt
hadoop fs -chown someuser:somegrp /hello.txt
hadoop fs -copyFromLocal ./jdk.tar.gz /aaa/
hadoop fs -copyToLocal /aaa/jdk.tar.gz
hadoop fs -cp /aaa/jdk.tar.gz /bbb/jdk.tar.gz.2
hadoop fs -mv /aaa/jdk.tar.gz /
hadoop fs -get /aaa/jdk.tar.gz
hadoop fs -getmerge /aaa/log.* ./log.sum
hadoop fs -put /aaa/jdk.tar.gz /bbb/jdk.tar.gz.2
hadoop fs -rm -r /aaa/bbb/
hadoop fs -rmdir /aaa/bbb/ccc
hadoop fs -df -h /
hadoop fs -du -s -h /aaa/*
hadoop fs -count /aaa/
hadoop fs -setrep 3 /aaa/jdk.tar.gz
这里设置的副本数只是记录在 Namenode 的元数据中,是否真的会有这么多副本,还得看 Datanode 的数量
因为目前只有3台设备,最多也就3个副本,只有节点数的增加到10台时,副本数才能达到10