You can run Hadoop commands from anywhere on the terminal / command line, but only if the $path variable is set.
The syntax will be like this:
hadoop fs -<command> or hdfs fs -<command>
You will review the documents for more information.
source share