Can not list/access files of local system from hadoop

0 votes

I have some files in this path /home/user/local-base/

I am trying to list the files in this directory using the following command:

hdfs dfs -ls /home/user/local-base/

But I am getting this error:

WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable ls: `/home/user/local-base/': No such file or directory

The path exists:

$ pwd

/home/user/local-base/
Dec 12, 2018 in Big Data Hadoop by digger
• 26,550 points
59 views

1 answer to this question.

0 votes

You can not directory use files from your local directory. Try this:

hdfs dfs -mkdir /user
hdfs dfs -mkdir /user/local-base
hdfs dfs -ls /user/local-base
echo "Hello World" > file01
hadoop fs -copyFromLocal /user/local-base
hadoop fs -cat /user/local-base/file01
answered Dec 12, 2018 by Omkar
• 67,520 points

Related Questions In Big Data Hadoop

0 votes
1 answer

Can I have a list of property files used in Hadoop Framework?

Here is a complete list of configuration ...READ MORE

answered Aug 14, 2018 in Big Data Hadoop by Frankie
• 9,810 points
64 views
0 votes
1 answer

How can I access S3/S3n from a local Hadoop 2.6 installation?

For some reason, the jar hadoop-aws-[version].jar which contains the ...READ MORE

answered Oct 3, 2018 in Big Data Hadoop by digger
• 26,550 points
876 views
0 votes
1 answer
0 votes
1 answer
+1 vote
2 answers

What does hadoop fs -du command gives as output?

du command is used for to see ...READ MORE

answered Jul 23 in Big Data Hadoop by Lokesh Singh
885 views
0 votes
1 answer

How can I write text in HDFS using CMD?

Hadoop put & appendToFile only reads standard ...READ MORE

answered Apr 27, 2018 in Big Data Hadoop by Shubham
• 13,290 points
79 views
0 votes
1 answer

What is the command to find the free space in HDFS?

You can use dfsadmin which runs a ...READ MORE

answered Apr 29, 2018 in Big Data Hadoop by Shubham
• 13,290 points
181 views
0 votes
1 answer

How to find the used cache in HDFS

hdfs dfsadmin -report This command tells fs ...READ MORE

answered May 4, 2018 in Big Data Hadoop by Shubham
• 13,290 points
216 views
0 votes
1 answer

Hadoop: How to copy directory from local system to hdfs using Java code?

Just use the FileSystem's copyFromLocalFile method. If the source Path ...READ MORE

answered Nov 14, 2018 in Big Data Hadoop by Omkar
• 67,520 points
531 views
0 votes
5 answers

Hadoop hdfs: list all files in a directory and its subdirectories

Hi, You can try this command: hadoop fs -ls ...READ MORE

answered Aug 1 in Big Data Hadoop by Dinish
1,692 views