With my latest assignment I have started exploring Hadoop and related technologies. When exploring HDFS and playing with it, I came across these two syntaxes of querying HDFS:

> hadoop dfs
> hadoop fs

Initally could not differentiate between the two and keep wondering why we have two different syntaxes for a common purpose. I googled the web and found people too having the same question and below are there reasonings:

Per Chris explanation looks like there's no difference between the two syntaxes. If we look at the definitions of the two commands (hadoop fs and hadoop dfs) in $HADOOP_HOME/bin/hadoop
...
elif [ "$COMMAND" = "datanode" ] ; then
  CLASS='org.apache.hadoop.hdfs.server.datanode.DataNode'
  HADOOP_OPTS="$HADOOP_OPTS $HADOOP_DATANODE_OPTS"
elif [ "$COMMAND" = "fs" ] ; then
  CLASS=org.apache.hadoop.fs.FsShell
  HADOOP_OPTS="$HADOOP_OPTS $HADOOP_CLIENT_OPTS"
elif [ "$COMMAND" = "dfs" ] ; then
  CLASS=org.apache.hadoop.fs.FsShell
  HADOOP_OPTS="$HADOOP_OPTS $HADOOP_CLIENT_OPTS"
elif [ "$COMMAND" = "dfsadmin" ] ; then
  CLASS=org.apache.hadoop.hdfs.tools.DFSAdmin
  HADOOP_OPTS="$HADOOP_OPTS $HADOOP_CLIENT_OPTS"
...
that's his reasoning behind the difference.

I am not convinced with this, I looked out for a more convincing answer and here's are a few excerpts which made better sense to me:

FS relates to a generic file system which can point to any file systems like local, HDFS etc. But dfs is very specific to HDFS. So when we use FS it can perform operation with from/to local or hadoop distributed file system to destination . But specifying DFS operation relates to HDFS.

Below are the excerpts from hadoop documentation which describes these two as different shells.


FS Shell
The FileSystem (FS) shell is invoked by bin/hadoop fs . All the FS shell commands take path URIs as arguments. The URI format is scheme://autority/path. For HDFS the scheme is hdfs, and for the local filesystem the scheme is file. The scheme and authority are optional. If not specified, the default scheme 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 (given that your configuration is set to point to hdfs://namenodehost). Most of the commands in FS shell behave like corresponding Unix commands. 

DFShell
The HDFS shell is invoked by bin/hadoop dfs . All the HDFS shell commands take path URIs as arguments. The URI format is scheme://autority/path. For HDFS the scheme is hdfs, and for the local filesystem the scheme is file. The scheme and authority are optional. If not specified, the default scheme 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 (given that your configuration is set to point to namenode:namenodeport). Most of the commands in HDFS shell behave like corresponding Unix commands. 

So from the above it can be concluded that it all depends upon the scheme configure. When using this two command with absolute URI, i.e. scheme://a/b the behavior shall be identical. Only its the default configured scheme value for file and hdfs for fs and dfs respectively which is the cause for difference in behavior.
Profiling with Spring AOP
Profiling with Spring AOP
Locking Management in JPA
Locking Management in JPA
Coding Contest - Arranging numbers from 1 to 71 in a sequence such that sum of any 2 adjacent numbers in the sequence adds up to a prime number
Setup Jenkins Continuous and Automatic Build System
CodeReviewer - Free Peer Code Review Tool
Hudson Plugin for Eclipse
Automatic Sequence Diagram Generation
Audit Logging using Hibernate Interceptor in JPA 2.0
Splunk - A Solution for Centralized Logging
ESB vs. EAI frameworks
ESB vs. EAI frameworks
Esper EPL Modules
Esper EPL Modules
Storm for CEP
Storm for CEP
Storm Spout : Push vs. Pull
Cassandra: Schema Disagreement Problem
Cassandra: Schema Disagreement Problem
Cassandra: Hector Guava issue
Cassandra: Hector Guava issue
Cassandra Composite: Generic Insert
Cassandra Composite: Generic Insert
XML Databases
JPA 2.0 + Hibernate: OrphanRemoval & CascadeType.REMOVE
JPA 2.0 + Hibernate: OrphanRemoval & CascadeType.REMOVE
Testing Syslog functionality inside Graylog2
JPA 2.0 Criteria Query with Hibernate
JPA 2.0 Criteria Query with Hibernate
HDFS to Mongo migration
HDFS to Mongo migration
Liferay + Spring MVC Portlet
Sharing Client Time-Zone information with Server
Sharing Client Time-Zone information with Server
Predictions for 2013 contd..
Predictions for 2013 contd..
Spring Batch for Hadoop - Word Count example
Spring Batch for Hadoop - Word Count example
Getting started with Apache Camel
Spring for Apache Hadoop Issues
Spring for Apache Hadoop Issues
Hive hassles
Hive hassles
Introduction to Enterprise Integration Patterns
JavaScript Everywhere
Sketching the map
Challenges faced when setting first Hadoop cluster
Challenges faced when setting first Hadoop cluster
Class diagram generation from Java source
Difference between 'hadoop dfs' and 'hadoop fs'
Difference between 'hadoop dfs' and 'hadoop fs'
About maps!
Oracle cursors performance improvement
Oracle cursors performance improvement
Marking the map
Rescuing maven dependency mediation
Remedy to cyclic dependencies
Remedy to cyclic dependencies
Caution While Initializing Static Data
Caution While Initializing Static Data
Comparision: Prototype, Dojo, jQuery, mootools and SmartClient
Comparision: Prototype, Dojo, jQuery, mootools and SmartClient
Java API to Detect Virus Using ClamAV Antivirus
Java API to Detect Virus Using ClamAV Antivirus
Third Party JAVA APIs (SFTP Client) for Remote File Operations
Third Party JAVA APIs (SFTP Client) for Remote File Operations
Maven - Java Plugin Development
Maven - Java Plugin Development
Maven - Lifecycle, Goals & Plugin
Maven - Lifecycle, Goals & Plugin
Maven - Project Object Model
Maven - Project Object Model
Oracle explain plan discrepancy (for queries with bind variables)
Oracle explain plan discrepancy (for queries with bind variables)
Roma Meta Framework
Roma Meta Framework
Fax Solution - Hylafax / IAXModems / Asterisk
Fax Solution - Hylafax / IAXModems / Asterisk
SmartChart - Designing smartclient charting feature with third party javascript charting API.
Monitoring and Management Java applications using JManage
Monitoring and Management Java applications using JManage
JQuery vs Dojo
Code Coverage Reports using Cobertura
Code Coverage Reports using Cobertura
Heirarchical Query
JOSSO - Integration Overview
Problem with long running request
Problem with long running request
Comparision of various open source cache implementations
Comparision of various open source cache implementations
Accessing HTML/Javascript in an Applet
Accessing HTML/Javascript in an Applet
Exporting Object into RMI
Exporting Object into RMI
Widget Based Web Application Framework
Widget Based Web Application Framework
Handling User Preferences
Handling User Preferences
TOMCAT: JAVA_OPTS versus CATALINA_OPTS
TOMCAT: JAVA_OPTS versus CATALINA_OPTS
Authentication not required across tomcat restart
Authentication not required across tomcat restart
Spring Security 2
Spring Security 2
SymmetricDS
SymmetricDS
JacORB migration to 2.3.0
JacORB migration to 2.3.0
Modify Java Classpath at Runtime
Modify Java Classpath at Runtime
XSLTC error: Impossible to load the translet class
XSLTC error: Impossible to load the translet class
Oracle DB Server Version
Oracle DB Server Version
java.lang.OutOfMemoryError: PermGen space
java.lang.OutOfMemoryError: PermGen space
Xalan: java.lang.ClassFormatError: Invalid method Code length
Xalan: java.lang.ClassFormatError: Invalid method Code length
Loading