Question on creating directory in HDFS



0

Hi Created a directory in HDFS using 

hdfs fs -mkdir manoj.

whenever i tried to do some operation on that directory like copyFromLocal or rm or mv it says

copyFromLocal: `/manoj/file1': No such file or directory
 

But when i say 

hadoop fs -ls 

i can see that directory. Please help me out.

 

thanks

Manoj


1 Answer(s)


0

Hi Manoj,

Writing the command -

$ hadoop fs -mkdir manoj

is same as

$ hadoop fs -ls /user/<username>/manoj

 

The command - $ hadoop fs -ls OR $ hadoop fs -ls /user/<username>/

Reason: If you don't mention the complete path, it start with default path which is /user/<username>

To copy file into manoj directory, you can use the following command-

$ hadoop fs -copyFromLocal manoj/
OR
$ hadoop fs -copyFromLocal /user/<username>manoj/

 

Hope this helps.

Thanks.

Your Answer

Click on this code-snippet-icon icon to add code snippet.

Upload Files (Maximum image file size - 1.5 MB, other file size - 10 MB, total size - not more than 50 MB)

Email
Password