Hadoop ls
In Hadoop, the hadoop fs -ls
command is used to list the files and directories in a specified Hadoop Distributed File System (HDFS) directory. It’s similar to the ls
command in Unix/Linux for listing files and directories in a local file system. Here’s the basic syntax of the hadoop fs -ls
command:
hadoop fs -ls <HDFS-path>
<HDFS-path>
: This is the path to the directory or file in HDFS that you want to list. It can be an absolute or relative HDFS path.
Examples:
To list the contents of the root directory in HDFS, you can use the following command:
bashhadoop fs -ls /
This command will display the files and subdirectories in the root directory of HDFS.
To list the contents of a specific directory in HDFS, you can provide the path to that directory:
bashhadoop fs -ls /user/yourusername/some_directory
Replace
/user/yourusername/some_directory
with the actual path you want to list.To list the contents of a file in HDFS, you can provide the path to that file:
bashhadoop fs -ls /user/yourusername/some_directory/some_file.txt
This will provide information about the specified file, including its permissions, owner, group, size, and modification timestamp.
Hadoop Training Demo Day 1 Video:
Conclusion:
Unogeeks is the No.1 IT Training Institute for Hadoop Training. Anyone Disagree? Please drop in a comment
You can check out our other latest blogs on Hadoop Training here – Hadoop Blogs
Please check out our Best In Class Hadoop Training Details here – Hadoop Training
Follow & Connect with us:
———————————-
For Training inquiries:
Call/Whatsapp: +91 73960 33555
Mail us at: info@unogeeks.com
Our Website ➜ https://unogeeks.com
Follow us:
Instagram: https://www.instagram.com/unogeeks
Facebook:https://www.facebook.com/UnogeeksSoftwareTrainingInstitute
Twitter: https://twitter.com/unogeeks