Hajmola
Hajmola

Reputation: 93

How do you put files in a hdfs directory with space in the directory name?

I am trying to put a file in a HDFS directory with the directory name containing space. The following issue occurs:

Suppose hdfs directory “sub dir1” already exists. Now I tried to put a file, sub.txt in this directory using following command:

hadoop fs -put sub.txt /user/jdutt/TempTesting/output//sub\ dir1/

It doesn’t put file in “sub dir1” directory; instead it creates another directory with the name “sub%20dir1” and puts file there. How to solve this issue?

Upvotes: 4

Views: 4794

Answers (4)

kamal
kamal

Reputation: 73

hadoop fs -copyFromLocal /home/cloudera/Documents/Hadoop/Hive%20Data/empdata hive_data

it's working for me

Upvotes: 0

Jamsheer
Jamsheer

Reputation: 3753

Please replace spaces with %20 ,It may solve your problem .

Upvotes: 4

wangwei
wangwei

Reputation: 196

hadoop fs -put sub.txt "/user/jdutt/TempTesting/output/sub dir1"

Upvotes: -2

Vikas Hardia
Vikas Hardia

Reputation: 2695

Please try to run command as

hadoop fs -put sub.txt /user/jdutt/TempTesting/output/'sub dir1'/

i have tested it on hadoop viersion 1.0.4 and it is working.

Upvotes: 1

Related Questions