FS refers to a common file system that can point to any file system, such as local, HDFS, etc. But dfs is very specific to HDFS. Therefore, when we use FS , it can perform an operation from / from a local or distributed file system with a distributed file system to the destination. But the DFS operation reference refers to HDFS.
The following are excerpts from the suffix documentation that describes the two as different shells.
FS Shell The FileSystem (FS) shell is invoked by bin / hadoop fs. All FS shell commands accept path URIs as arguments. The URI format is a scheme: // autority / path. For HDFS, the hdfs scheme, and for the local file system, a file. Scheme and credentials are optional. If not specified, the default schema specified in the configuration is used. An HDFS file or directory, such as / parent / child, can be specified as hdfs: // namenodehost / parent / child or simply as / parent / child (assuming your configuration is set to hdfs: // namenodehost). Most commands in the FS shell behave like corresponding Unix commands.
DFShell The HDFS wrapper is invoked by bin / hadoop dfs. All HDFS shell commands accept path URIs as arguments. The URI format is a scheme: // autority / path. For HDFS, the hdfs scheme, and for the local file system, a file. Scheme and credentials are optional. If not specified, the default schema specified in the configuration is used. An HDFS file or directory, such as / parent / child, can be specified as hdfs: // namenode: namenodeport / parent / child, or simply as / parent / child (assuming your configuration is set to namenode: namenodeport). Most commands in the HDFS shell behave like corresponding Unix commands.
So, from the above, we can conclude that it all depends on the configure scheme. When using these two commands with an absolute URI, that is, the scheme: // a / b, the behavior should be identical. Only its standard configured schema value for files and hdfs for fs and dfs respectively, which causes differences in behavior.
Isaac Aldana Oct 17 '15 at 13:34 2015-10-17 13:34
source share