0

I am trying to copy a text file on my Mac Desktop to hdfs, for that purpose I am using this code

hadoop fs -copyFromLocal Users/Vishnu/Desktop/deckofcards.txt  /user/gsaikiran/cards1 

But it is throwing an Error

copyFromLocal: `deckofcards.txt': No such file or directory

It sure exists on the desktop

Chris
  • 4,672
  • 13
  • 52
  • 93
JonSnow
  • 1
  • 2

1 Answers1

2

Your command is missing a slash / at the source file path. It should be:

hadoop fs -copyFromLocal /Users/Vishnu/Desktop/deckofcards.txt /user/gsaikiran/cards1

more correctly/efficiently,

hdfs dfs -put /Users/Vishnu/Desktop/deckofcards.txt /user/gsaikiran/cards1

Also, if you are dealing with HDFS specifically, better to use hdfs dfs syntax instead of hadoop fs [1]. (It doesn't change the output in your case, but hdfs dfs command is designed for interacting with HDFS whereas hadoop fs is the deprecated one)

Community
  • 1
  • 1
PradeepKumbhar
  • 3,361
  • 1
  • 18
  • 31