Experiment No.
Title: Working with HADOOP commands
Apache Hadoop is an open source framework that is used to efficiently store and process
large datasets ranging in size from gigabytes to petabytes of data. Instead of using one large
computer to store and process the data, Hadoop allows clustering multiple computers to
analyze massive datasets in parallel more quickly.
1. Version
Hadoop HDFS version Command Usage:
The Hadoop fs shell command version prints the Hadoop version
Hadoop HDFS version Command Description:
The Hadoop fs shell command version prints the Hadoop version.
2. mkdir
Hadoop HDFS mkdir Command Usage:
Hadoop HDFS mkdir Command Description:
This command creates the directory in HDFS if it does not already exist.
3. ls
Hadoop HDFS ls Command Usage:
Here in the below example, we are using the ls command to enlist the files and directories
present in HDFS.
4. put
Hadoop HDFS put Command Usage:
Here in this example, we are trying to copy localfile1 of the local file system to the Hadoop
filesystem.
Hadoop HDFS put Command Description:
The Hadoop fs shell command put is similar to the copyFromLocal, which copies files or
directory from the local filesystem to the destination in the Hadoop filesystem.
5. copyFromLocal
Hadoop HDFS copyFromLocal Command Usage:
Here in the below example, we are trying to copy the ‘test1’ file present in the local file
system to the newDataFlair directory of Hadoop.
Hadoop HDFS copyFromLocal Command Example:
Here in the below example, we are trying to copy the ‘test1’ file present in the local file
system to the newDataFlair directory of Hadoop.
6. get
Hadoop HDFS get Command Usage:
In this example, we are trying to copy the ‘file’ of the hadoop filesystem to the local file
system.
Hadoop HDFS get Command Description:
The Hadoop fs shell command get copies the file or directory from the Hadoop file system to
the local file system.
7. copyToLocal
Hadoop HDFS copyToLocal Command Usage:
Here in this example, we are trying to copy the ‘sample’ file present in the newDataFlair
directory of HDFS to the local file system.
Hadoop HDFS copyToLocal Description:
copyToLocal command copies the file from HDFS to the local file system.
8. cat
Hadoop HDFS cat Command Usage:
Here in this example, we are using the cat command to display the content of the ‘sample’
file present in newDataFlair directory of HDFS.
Hadoop HDFS cat Command Description:
The cat command reads the file in HDFS and displays the content of the file on console or
stdout.
9. mv
Hadoop HDFS mv Command Description:
The HDFS mv command moves the files or directories from the source to a destination
within HDFS.
10. cp
Hadoop HDFS cp Command Description:
The cp command copies a file from one directory to another directory within the HDFS.