Scaling Namespaces and Optimizing Data Storage
Also available as:
PDF
loading table of contents...

List files in Hadoop archives

Use the hdfs dfs -ls command to list files in Hadoop archives.

Run the hdfs dfs -ls command by specifying the archive directory location.
To specify the directories in an archive directory foo.har located in /usr/zoo, run the following command:
hdfs dfs -ls har:///user/zoo/foo.har/
Assuming the archive directory foo.har contains two directories dir1 and dir2, the command returns the following

har:///user/zoo/foo.har/dir1
har:///user/zoo/foo.har/dir2
Note
Note
Consider an archive created using the following command:
hadoop archive -archiveName foo.har -p /user/ hadoop/dir1 hadoop/dir2 /user/zoo

If you list the files of the archive created in the preceding command, the command returns the following:

har:///user/zoo/foo.har/hadoop
har:///user/zoo/foo.har/hadoop/dir1
har:///user/zoo/foo.har/hadoop/dir2

Note that the modified parent argument causes the files to be archived relative to /user/.