Introduction
Imagine a magical night sky filled with twinkling stars above, where a brave interstellar explorer embarks on a thrilling adventure. In this scenario, our goal is to navigate through the Hadoop HDFS using the "FS Shell ls" command to unveil hidden treasures of data and information in the vast digital universe.
Exploring the Hadoop File System
In this step, we will dive into the realm of the Hadoop File System (HDFS) and use the hadoop fs -ls command to list directories and files.
Switch to the Hadoop user:
su - hadoopList the contents of the user's home directory in HDFS:
hadoop fs -ls /the command run successfully means the Hadoop environment is ready and we can use hadoop command.
Navigating through Directories
Let's continue our journey by navigating further into directories within HDFS using the hadoop fs -ls command.
Create a new directory in HDFS:
hadoop fs -mkdir /labList the contents of the newly created directory:
hadoop fs -ls /
Exploring File Details
In this step, let's delve into the details of specific files within HDFS by using the hadoop fs -ls command with a file path.
Upload a sample file to the lab directory in HDFS:
echo 'Hello, Hadoop!' > sample.txt hadoop fs -put sample.txt /labList details of the uploaded file:
hadoop fs -ls /lab/sample.txt
Summary
In this lab, we embarked on a journey through the Hadoop File System using the "FS Shell ls" command to explore directories, navigate through paths, and uncover file details. By following the step-by-step instructions and leveraging the power of Hadoop, users can enhance their understanding of HDFS and effectively manage data within the distributed environment.



