The article directories
- 1. HDFS Shell
-
- 1.1 HDFS Shell CLI client
- 1.2 HDFS Shell CLI Client — Description
- 1.3 summarize
- 1.4 Differences between Hadoop DFS, HDFS DFS, and Hadoop FS
- 1.5 HDFS Shell CLI Client – Parameter Description
- 1.6 Finding commands on the Hadoop official website
1. HDFS Shell
1.1 HDFS Shell CLI client
- Command line interface (CLI) refers to an interpersonal interaction mode in which users input commands through the keyboard and the computer executes the commands after receiving them.
- Hadoop provides a shell command line client for the file system, which can be used as follows:
- The commands related to file system reads and writes are
hdfs dfs [generic options]
1.2 HDFS Shell CLI Client – Description
- HDFS Shell THE CLI supports operation of various file systems, including local file systems (
file:///
), distributed file system (hdfs://nn:8020
) etc. - What file system you operate on depends on the prefix protocol in the URL.
- If no prefix is specified, the fs.defaultfs property in the environment variable is read with the value of that property as the default file system
hdfs dfs -ls file:/// Operating on the local file system
Copy the code
hdfs dfs -ls /
Copy the code
- View the file default system
cat /export/servers/hadoop2 -.7.4/etc/hadoop/core-site.xml
Copy the code
hdfs dfs -ls hdfs://hadoop01:9000/ # Run HDFS
Copy the code
- so
hdfs dfs -ls hdfs://hadoop01:9000/
和hdfs dfs -ls /
Accessing the same file system.
1.3 summarize
1.4 Differences between Hadoop DFS, HDFS DFS, and Hadoop FS
hadoop dfs
You can only operate HDFS files (including Local FS operations), but this operation has been Deprecated.hdfs dfs
Perform operations related to HDFS file systems (including Local FS operations)hadoop fs
It can operate any file system, not only HDFS file system, but also a wide range of applications.
- According to the current version, the official final recommendation is
hadoop fs
. Of course,hdfs dfs
The use in the market is also more.
1.5 HDFS Shell CLI Client – Parameter Description
- The OPERATION commands of HDFS are similar to those of Linux. Therefore, it is relatively cheap to learn.
- Can be achieved by
hadoop fs -help
Command to see the detailed usage of each command.
1.6 Finding commands on the Hadoop official website
- You can also follow these steps to find the command on the official website.
- Website:Hadoop.apache.org/, select the corresponding Hadoo…
- find
Commands Reference
Hadoop 3.2.2
Version command:Hadoop.apache.org/docs/r3.2.2…