Hadoop 2.7.3 Shell

Source: Internet
Author: User
Tags readable hdfs dfs hadoop fs

[Email protected] ~]$ HDFs dfs-help

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] [-l] <localsrc> ... <dst>]
[-copytolocal [-P] [-IGNORECRC] [-CRC] <src> ... <localdst>]
[-count [-Q] [-h] <path> ...]
[-CP [-f] [-P |-p[topax]] <src> ... <dst>]
[-createsnapshot <snapshotDir> [<snapshotname>]]
[-deletesnapshot <snapshotDir> <snapshotname>]
[-DF [-h] [<path> ...]
[-DU [-S] [-h] <path> ...]
[-expunge]
[-find <path> ...]
[-get [-P] [-IGNORECRC] [-CRC] <src> ... <localdst>]
[-getfacl [-R] <path>]
[-getfattr [-R] {-N name |-d} [-E en] <path>]
[-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] [-l] <localsrc> ... <dst>]
[-renamesnapshot <snapshotDir> <oldName> <newname>]
[-RM [-F] [-r|-r] [-skiptrash] <src> ...]
[-rmdir [--ignore-fail-on-non-empty] <dir> ...]
[-setfacl [-R] [{-b|-k} {-m|-x <acl_spec>} <path>]| [--set <acl_spec> <path>]
[-setfattr {-n name [-V value] |-x name} <path>]
[-setrep [-R] [-W] <rep> <path> ...]
[-STAT [format] <path> ...]
[-tail [-F] <file>]
[-test-[defsz] <path>]
[-text [-IGNORECRC] <src> ...]
[-touchz <path> ...]
[-truncate [-W] <length> <path> ...]
[-usage [cmd ...]]

-appendtofile <localsrc> ... <dst>:
Appends the contents of all given local files to the given destination file. If the destination file does not exist, the target file is created. If < LOCALSRC > is-, read the input from the standard:

-cat [-IGNORECRC] <src> ...:
Gets all files that match file mode < src> and displays their contents in standard output.
-checksum <src> ...:
Verifying file information

-CHGRP [-R] GROUP PATH ...:
Similar to the modified file group command in the shell

-chmod [-R] <mode[,mode] ... | Octalmode> PATH ...:
Modify file permission command similar to shell
-R Recursive modification file

-chown [-R] [Owner][:[group]] PATH ...:
A modified file similar to the shell is the main command
-R Recursive modification file

-copyfromlocal [-f] [-P] [-l] <localsrc> ... <dst>:
Same as the-put command

-copytolocal [-P] [-IGNORECRC] [-CRC] <src> ... <localdst>:
Same as the-get command

-count [-Q] [-h] <path> ...:
Calculates the number of directories, files, and bytes that match a specified file pattern under a path

-CP [-f] [-P |-p[topax]] <src> ... <dst>:
Copy file, [-f] When the cloud already has files, force overwrite

-createsnapshot <snapshotDir> [<snapshotname>]:
To create a snapshot on a directory

-deletesnapshot <snapshotDir> <snapshotName>:
Delete a snapshot from the directory
-DF [-h] [<path> ...]:
Displays the file system's capacity, free space, and used space. If the file system has more than one partition and the path to a specific partition is not specified, the state of the root partition is displayed.

-H formats the size of the file, not the number of bytes, in a human-readable manner.

-du [-S] [-h] <path> ...:
Displays the amount of space (in bytes) used by files that match the specified file pattern. The following tags are optional:

-S does not display the size of each individual file that matches the pattern, showing the total (summary) size
-H formats the size of the file in a human-readable way, not the number of bytes

-expunge:
Delete files from a trash bin that is earlier than the reserved threshold value

-find <path> <expression> ...:
Finds all files that match the specified expression and applies the selected action to them. If < path is not specified, the current working directory is considered. If you do not specify an expression, the default is-print

-get [-P] [-IGNORECRC] [-CRC] <src> ... <localdst>:
Copy the files that match the < src> to Local. When copying multiple files, the target must be a directory
-P retains access and modification time, ownership, and mode

-getfacl [-R] <path>:
Displays the access control lists (ACLs) for files and directories. If the directory has a default ACL, GETFACL also displays the default ACL
-R recursively lists ACLs for all files and directories.

-getfattr [-r] {-N name |-d} [-E en] <path>:
Displays the extended property name and value (if any) of the file or directory.
-R lists the properties of all files and directories.
-N name dump named extended property value.
The-D dump of all extended property values associated with the path name.

-getmerge [-NL] <src> <localdst>:
Gets all the files in the directory that match the source file pattern, and merges them into only one file on the local file system. < src> save.
-nl adds line breaks at the end of each file.

-help [cmd ...]:
Displays Help if you specify a command or all commands.

-ls [-d] [-h] [-r] [<path> ...]:
Lists content that matches the specified file pattern. If no path is specified, the current user's content Directory is listed

-D directory listed as pure file
-H formats the size of the file, not the number of bytes, in a human-readable manner.
-R recursively lists the contents of a directory

-mkdir [-P] <path> ...:
Create a directory at the specified location
-P If the directory already exists, please do not fail to continue creating the directory

-movefromlocal <localsrc> ... <dst>:
Same as-put, just delete the source after copying

-movetolocal <src> <localdst>:
Has not started to enable

-MV <src> ... <dst>:
Moves files that match the specified file mode < src > to target < dst>. When moving multiple files, the target must be a directory

-put [-f] [-P] [-l] <localsrc> ... <dst>:
Copy the file from the local file system to FS. If the file already exists, the copy fails unless given the-F flag
-P retains access and modification time, ownership, and mode.
-F If the target already exists, overwrite the target
-L allows Datanode delay to save files to disk. Forcing the number of replicas to 1 will result in reduced data durability and careful use

-renamesnapshot <snapshotDir> <oldName> <newName>:
Rename a snapshot from oldname to NewName

-RM [-F] [-r|-r] [-skiptrash] <src> ...:
Delete all files that match the specified file pattern
-skiptrash Bypass Trash, if enabled, and delete now < src >
-F If the file does not exist, the diagnostic message is not displayed or the exit status is modified to reflect the error
-[RR] recursively delete a directory

-rmdir [--ignore-fail-on-non-empty] <dir> ...:
Deletes the directory entry specified by each directory parameter, as long as it is empty

-setfacl [-R] [{-b|-k} {-m|-x <acl_spec>} <path>]| [--set <acl_spec> <path>]:
Set access control lists (ACLs) for files and directories
-B deletes all entries except the base ACL.
-K Delete the default ACL
-R recursively applies operations to all files and directories.
-M modifies the ACL. The new entry is added to the ACL, and the existing entries are preserved.
-X Deletes the specified ACL entry. Keep other ACL entries
--set completely replaces the ACL, discarding all existing entries. Must include compatibility entries for user, group, and other user and permission bits

Comma-delimited list of <acl_spec> ACL entries.

-setfattr {-n name [-V value] |-x name} <path>:
Sets the extended property name and value for a file or directory.

-N Name Extended property name
-V Value Extended property value
-X Name Delete extended property

-setrep [-R] [-W] <rep> <path> ...:
To set the replication level for a file
-W It requests the command to wait for replication to complete. This may take a long time.
-R It is accepted for backward compatibility. It has no effect

-stat [format] <path> ...:
Print statistics for files/directories at < path > in the specified format

-tail [-f] <file>:
Display the last 1KB part of the file
-F Displays data added with file growth

-test-[defsz] <path>:
Answer questions about < path > and tell the result by status code
-D If <path> is a directory, return 0
-E If <path> is present, returns 0
-F If <path> is a file, return 0
-S if <path> is greater than 0 bytes, returns 0
-Z If file < path > is 0 bytes, 0 is returned, otherwise 1 is returned.

-text [-IGNORECRC] <src> ...:
Get the source file and output the file in text format

-touchz <path> ...:
Create an empty file in < path >, with the current time as the timestamp for the < path >. An error is returned if the file has a length other than 0.

-truncate [-W] <length> <path> ...:
Delete all files that are matched to
-W Request command waits for data block recovery to complete (if necessary)

-usage [cmd ...]:
Displays the usage of the given command, and displays the usage of any command if it is not specified
Common options Supported:
-conf <configuration file> Specifying an app's configuration file
-D <property=value> Usage values for a given property
-fs <local|namenode:port> Specify a Namenode
-JT <local|resourcemanager:port> Specify a ResourceManager
-files <comma separated list of files> specifies files that are copied into the map reduce cluster using commas
-libjars <comma separated list of jars> specifying a comma-delimited jar file to include in Classpath
-archives <comma separated list of archives> specify a comma-delimited archive file to be on the computer

Hadoop 2.7.3 Shell

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.