How to list files in hadoop?

How to list files in hadoop?

Hi,

I want to list the files from a directory in HDFS. How to list files in hadoop?

Thanks

View Answers

May 13, 2017 at 7:27 PM

Hi,

Hadoop uses its own file system which is know as Hadoop File System or HDFS.

Hadoop provides commands to interact with the HDFS. To list down all the file in a directory you can use the following command:

hadoop fs -ls /

Above command lists all the files from the root of HDFS.

Sample output:

hdfs@hadoop1:/home/deepak$ hadoop fs -ls /
Found 11 items
drwxrwxrwx   - yarn   hadoop          0 2017-05-13 18:33 /app-logs
drwxr-xr-x   - hdfs   hdfs            0 2016-04-26 19:30 /apps
drwxr-xr-x   - yarn   hadoop          0 2016-04-25 20:57 /ats
drwxr-xr-x   - hdfs   hdfs            0 2016-04-25 20:58 /hdp
drwxr-xr-x   - mapred hdfs            0 2016-04-25 20:58 /mapred
drwxrwxrwx   - mapred hadoop          0 2016-04-25 20:58 /mr-history
drwxrwxrwx   - spark  hadoop          0 2017-05-13 19:26 /spark-history
drwxr-xr-x   - hdfs   hdfs            0 2017-05-13 10:51 /system
drwxr-xr-x   - hdfs   hdfs            0 2017-05-11 22:52 /test
drwxrwxrwx   - hdfs   hdfs            0 2016-04-25 21:02 /tmp
drwxr-xr-x   - hdfs   hdfs            0 2017-05-13 18:33 /user
hdfs@hadoop1:/home/deepak$

Check more at Hadoop shell commands.

Thanks









Related Tutorials/Questions & Answers:
How to list files in hadoop?
ModuleNotFoundError: No module named 'hadoopy'
Advertisements
How to print list of files in client system
php show list of files
List files recursively in linux
get files list - Ajax
Retrieving list of uploaded files.
Java list files
ModuleNotFoundError: No module named 'list-files'
list files only - Java Beginners
FTP Server : List Files and Directories
PHP list all files
FTP Server: List all files name
PHP list all files in directory
ModuleNotFoundError: No module named 'list-files-py'
Display list of files from a directory using Java
How to delete files in Java?
how to backup files and folder with Java
files
files
files
How to show only hidden files in Terminal?
How to show only hidden files in Terminal?
How to show only hidden files in Terminal?
How To Write the FORM Tag Correctly for Uploading Files?
how to creating hbm files in hibernate using Myeclipse
How do I decompile Java class files?
How to upload files to server using JSP/Servlet?
How to avoid Java Code in JSP-Files?
how to download the uploaded folder files using jsp
How to Convert Text Files into Gzip File
how to read and write xml files in javascript
How to print differences of two text files
how to search a text in all files in a folder in unix
how to search a text in all files in a folder in unix
how to search a text in all files in a folder in unix
how to search a text in all files in a folder in unix
how to read files of directory objective c
how to search data in xml files using php
How to resume scp with partially copied files
How to convert multiple files in java to .zip format
How can I Convert my Image Files to Text Files? - IDE Questions
how to list volumes in docker
How to list databases in PostgreSQL
how to list environments in conda
how to list environments in conda
files that are present in any folder , how to make it clickable downloadble file in php
How Compare 2 xml files with JDOM - Java Beginners
How to convert many class files into one exe file?
How to convert many class files into one exe file?

Ads