Search code examples
hadoophdfs

Hadoop copying directory with contents


I am new to Hadoop and am doing a project for university. I have a folder called 'docs' that I have several text files in. When I look at it locally, I can see the various text files are there. When I copy it to Hadoop, the directory is empty.

The screenshot below shows the files in the local directory. Showing that docs contain multiple text files

I use copyFromLocal to copy the directory to HDFS. As far as I can tell it should be copying the contents too?

hadoop fs -copyFromLocal ./docs

This screenshot showing the directory is empty (or is it?) Screenshot showing docs directory on Hadoop


Solution

  • All directories (lines starting with d) show as having 0 size with the HDFS ls command. If you do hadoop fs -ls docs then you'll see all of the files and their sizes.