appendToFile
Usage: hdfs dfs -appendToFile <localsrc> ... <dst>
追加一个或者多个文件到hdfs制定文件中.也可以从命令行读取输入.
Returns 0 on success and 1 on error.
cat
Usage: hdfs dfs -cat URI [URI ...]
Returns 0 on success and -1 on error.
Chgrp【change group】
Usage: hdfs dfs -chgrp [-R] GROUP URI [URI ...]
chmod
Usage: hdfs dfs -chmod [-R] <MODE[,MODE]... | OCTALMODE> URI [URI ...]
chown
Usage: hdfs dfs -chown [-R] [OWNER][:[GROUP]] URI [URI ]
copyFromLocal
Usage: hdfs dfs -copyFromLocal <localsrc> URI
Similar to put command, except that the source is restricted to a local file reference.
copyToLocal
Usage: hdfs dfs -copyToLocal [-ignorecrc] [-crc] URI <localdst>
Similar to get command, except that the destination is restricted to a local file reference.
count
Usage: hdfs dfs -count [-q] [-h] <paths>
列出文件夹数量、文件数量、内容大小. The output columns with -count are: DIR_COUNT, FILE_COUNT, CONTENT_SIZE FILE_NAME
The -h option shows sizes in human readable format.
Returns 0 on success and -1 on error.
cp
Usage: hdfs dfs -cp [-f] [-p | -p[topax]] URI [URI ...] <dest>
Returns 0 on success and -1 on error.
du
Usage: hdfs dfs -du [-s] [-h] URI [URI ...]
Exit Code: Returns 0 on success and -1 on error.
dus
Displays a summary of file lengths.
Note: This command is deprecated. Instead use hdfs dfs -du -s.
expunge
get
Usage: hdfs dfs -get [-ignorecrc] [-crc] <src> <localdst>
Returns 0 on success and -1 on error.
getfacl
Usage: hdfs dfs -getfacl [-R] <path>
Returns 0 on success and non-zero on error.
getfattr
Usage: hdfs dfs -getfattr [-R] -n name | -d [-e en] <path>
Displays the extended attribute names and values (if any) for a file or directory.
Returns 0 on success and non-zero on error.
getmerge
Usage: hdfs dfs -getmerge <src> <localdst> [addnl]
ls
Usage: hdfs dfs -ls [-R] <args>
For a file returns stat on the file with the following format:
permissions number_of_replicas userid groupid filesize modification_date modification_time filename
For a directory it returns list of its direct children as in Unix. A directory is listed as:
permissions userid groupid modification_date modification_time dirname
Returns 0 on success and -1 on error.
lsr
Note: This command is deprecated. Instead use hdfs dfs -ls -R
mkdir
Usage: hdfs dfs -mkdir [-p] <paths>
Takes path uri's as argument and creates directories.
Returns 0 on success and -1 on error.
moveFromLocal
Usage: hdfs dfs -moveFromLocal <localsrc> <dst>
Similar to put command, except that the source localsrc is deleted after it's copied.
moveToLocal
Usage: hdfs dfs -moveToLocal [-crc] <src> <dst>
Displays a "Not implemented yet" message.
mv
Usage: hdfs dfs -mv URI [URI ...] <dest>
Returns 0 on success and -1 on error.
put
Usage: hdfs dfs -put <localsrc> ... <dst>
Returns 0 on success and -1 on error.
rm
Usage: hdfs dfs -rm [-f] [-r|-R] [-skipTrash] URI [URI ...]
Delete files specified as args.
Returns 0 on success and -1 on error.
rmr
Usage: hdfs dfs -rmr [-skipTrash] URI [URI ...]
Note: This command is deprecated. Instead use hdfs dfs -rm -r
setfacl
Usage: hdfs dfs -setfacl [-R] [-b|-k -m|-x <acl_spec> <path>]|[--set <acl_spec> <path>]
Sets Access Control Lists (ACLs) of files and directories.
Returns 0 on success and non-zero on error.
setfattr
Usage: hdfs dfs -setfattr -n name [-v value] | -x name <path>
Sets an extended attribute name and value for a file or directory.
Returns 0 on success and non-zero on error.
setrep
Usage: hdfs dfs -setrep [-R] [-w] <numReplicas> <path>
Returns 0 on success and -1 on error.
stat
Usage: hdfs dfs -stat URI [URI ...]
Returns the stat information on the path.
Exit Code: Returns 0 on success and -1 on error.
tail
Usage: hdfs dfs -tail [-f] URI
Displays last kilobyte of the file to stdout.
Exit Code: Returns 0 on success and -1 on error.
test
Usage: hdfs dfs -test -[ezd] URI
text
touchz
Usage: hdfs dfs -touchz URI [URI ...]
Exit Code: Returns 0 on success and -1 on error.