Issue in hdfs dfs command

0 votes

I am not able to use pwd or cd command in hdfs dfs. Is there any specific way to move to a certain directory in hdfs or to get the present working directory?

Jan 7, 2019 in Big Data Hadoop by slayer
• 29,370 points
1,422 views

1 answer to this question.

0 votes

Hadoop has a special file system called 'hdfs' where there is no concept of current or present working directory. And therefore, the hdfs does not support 'cd' command (in short, it is not required). To navigate through the directories in hdfs, the complete path should be provided. This can be done with 'hdfs dfs -ls <path>' command.

Suppose you have a directory named test2 under a directory named test. Now, to view the contents of the test2 directory in hdfs you can execute the below command,

hdfs dfs -ls test/test2

Now, if you have a .txt file in the directory test2 and you want to display the .txt file, then execute the below command,

hdfs dfs -cat test/test2/text_file_name.txt

answered Jan 7, 2019 by Omkar
• 69,220 points

Related Questions In Big Data Hadoop

0 votes
1 answer

Getting error in command hdfs dfs -mkdir

You are getting this error because the ...READ MORE

answered Apr 15, 2018 in Big Data Hadoop by Shubham
• 13,490 points
3,291 views
0 votes
1 answer
0 votes
5 answers
0 votes
1 answer

What is the command to navigate in HDFS?

First of all there is no command ...READ MORE

answered Apr 27, 2018 in Big Data Hadoop by Shubham
• 13,490 points
5,706 views
+1 vote
1 answer

Hadoop Mapreduce word count Program

Firstly you need to understand the concept ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 11,380 points
11,072 views
0 votes
1 answer

hadoop.mapred vs hadoop.mapreduce?

org.apache.hadoop.mapred is the Old API  org.apache.hadoop.mapreduce is the ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 11,380 points
2,570 views
+2 votes
11 answers

hadoop fs -put command?

Hi, You can create one directory in HDFS ...READ MORE

answered Mar 16, 2018 in Big Data Hadoop by nitinrawat895
• 11,380 points
109,054 views
–1 vote
1 answer

Hadoop dfs -ls command?

In your case there is no difference ...READ MORE

answered Mar 16, 2018 in Big Data Hadoop by kurt_cobain
• 9,350 points
4,639 views
0 votes
1 answer

What is the command to count number of lines in a file in hdfs?

hadoop fs -cat /example2/doc1 | wc -l READ MORE

answered Nov 22, 2018 in Big Data Hadoop by Omkar
• 69,220 points
4,072 views
–1 vote
1 answer

Hdfs command to see available free space in hdfs

Yes, you check the free space using ...READ MORE

answered Jan 22, 2019 in Big Data Hadoop by Omkar
• 69,220 points
821 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP