https://www.cppentry.com/bencandy.php?fid=115&id=223457
First, the basic concept of the HDFS Shell
1. Call File System (FS) Shell command should use the bin / hadoop fs command or bin hdfs dfs form / command. [For simplicity, generally added to the path in the bin directory]
2. All FS shell URI path as a command parameter.
URI format scheme: // authority / path. HDFS The scheme is hdfs, the local file system, scheme is file. Wherein the scheme and authority are optional, and if not added unspecified, the default configuration specified in the scheme. For example: hdfs: // namenode: namenodePort / parent / child, can be expressed as / parent / child (assuming the configuration file is namenode: namenodePort)
Behavior 3. Most FS Shell commands and corresponding command is similar LINUX Shell.
Two, HDFS's Shell command
Three, HDFS's Shell command (practice)
#hadoop fs -ls / View HDFS root directory
#hadoop fs -mkdir / test creates a directory in the root directory of the Test
#hadoop FS -put ./test.txt / or the Test #hadoop fs -copyFromLocal /test.txt / test upload files
#hadoop fs -get /test/test.txt or #hadoop fs -getToLocal /test/test.txt download files
#hadoop fs -rm /test1/test.txt delete files
#hadoop fs -rmr / test1 delete a folder
#hadoop fs -mv /test/test.txt / test1 move files