Hadoop Command Line Interface
Hadoop Command Line Interface
There are many other interfaces to HDFS, but the command line is one of the simplest
and, to many developers, the most familiar.
Explore the most essential and frequently used Hadoop HDFS commands to perform file
operations on the world’s most reliable storage.
Hadoop HDFS is a distributed file system that provides redundant storage space for files having
huge sizes. It is used for storing files that are in the range of terabytes to petabytes.
Hadoop HDFS Commands
With the help of the HDFS command, we can perform Hadoop HDFS file operations like changing
the file permissions, viewing the file contents, creating files or directories, copying file/directory
from the local file system to HDFS or vice-versa, etc.
Before starting with the HDFS command, we have to start the Hadoop services. To start the
Hadoop services do the following:
sbin/start-dfs.sh
In this Hadoop Commands tutorial, we have mentioned the top 10 Hadoop HDFS commands with
their usage, examples, and description.
Let us now start with the HDFS commands.
1. version
Example 2:
Note: If the directory already exists in HDFS, then we will get an error message that file already
exists.
Use hadoop fs mkdir -p /path/directoryname, so not to fail even if directory exists.
Learn various features of Hadoop HDFS from this HDFS features guide.
3. ls
Hadoop HDFS ls Command Usage:
hadoop fs -ls /path
Learn Internals of HDFS Data Read Operation, How Data flows in HDFS while reading the
file.
Any Doubt yet in Hadoop HDFS Commands? Please Comment.
6. get
We can cross-check whether the file is copied or not using the ls command.
1. moveFromLocal
Here in the below example we are recursively deleting the DataFlair directory using -r with rm
command.