0% found this document useful (0 votes)
11 views

Lab Assignment-1

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

Lab Assignment-1

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

LAB ASSIGNMENT – 1

Hadoop shell commands:-


1)jps:-

In Hadoop, the jps command is used to check the status of various Hadoop daemons
running on a system. It is particularly useful for verifying that Hadoop services are
up and running correctly, especially when troubleshooting or setting up a Hadoop
cluster.

2)mkdir:-

The hadoop fs -mkdir command is used to create directories within the Hadoop
Distributed File System (HDFS). It allows you to organize your HDFS storage by
setting up a folder structure.It also checks whether the folder/file is available or nor
if the folder exists then it returns File exists as mentioned above.

3)rmdir:-

This command is used to remove empty directories present in the specified


path.First it will check whether the directory is empty or not if it is empty then it
will remove or else it will return Directory is not empty.
4)-get

hadoop fs -get <HDFS_source_path> <local_destination_path>


The get command in Hadoop is used to copy files or directories from the Hadoop
Distributed File System (HDFS) to the local file system. It's an essential command
for retrieving data stored in HDFS for local use or analysis.

5)-put

hadoop fs -put <local_source_path> <HDFS_destination_path>


The put command in Hadoop is used to copy files or directories from the local file
system to the Hadoop Distributed File System (HDFS). This command is essential for
uploading data to HDFS so it can be processed by Hadoop.
6)-ls

The ls command in Hadoop is used to list files and directories in the Hadoop
Distributed File System (HDFS). It’s similar to the Linux ls command and provides
information about files and directories within HDFS.
7)-cat

hadoop fs -cat <HDFS_file_path>


The cat command in Hadoop is used to display the contents of a file stored in the
Hadoop Distributed File System (HDFS) directly to the console. It’s similar to the
Linux cat command, but it operates on files within HDFS.

8)-cp
hadoop fs -cp <source_path> <destination_path>
The cp command in Hadoop is used to copy files or directories from one location to
another within the Hadoop Distributed File System (HDFS). It works similarly to the
Linux cp command but is specific to HDFS operations.

9)-mv

hadoop fs -mv <source_path> <destination_path>


The mv command in Hadoop is used to move files or directories within the Hadoop
Distributed File System (HDFS). It can also be used to rename files or directories
within HDFS. It functions similarly to the Linux mv command but is specifically for
operations in HDFS.

10)-copyFromLocal

hadoop fs -copyFromLocal <local_path> <hdfs_path>


The copyFromLocal command in Hadoop is used to copy files or directories from
the local file system to the Hadoop Distributed File System (HDFS). It is similar to
the put command and is often used to transfer data files for processing in HDFS.

You might also like