Hadoop dfs -ls command

–1 vote

I have Hadoop installed in this location:

/usr/local/hadoop$

Here I am listing out the files present in my dfs directory. So for this, I used the command: user1@ubuntu:/usr/local/hadoop$ bin/hadoop dfs -ls

This gave me the correct result.

But after that, I tried the same command in a different manner

user1@ubuntu:/usr/local/hadoop$ hadoop dfs -ls

I again got the same result.

Could anyone explain me that why I'm getting the same result despite of executing the commands from different folders. I hope you understand my question, I just want to know the difference between the two commands:

1. user1@ubuntu:/usr/local/hadoop$ bin/hadoop dfs -ls

2. user1@ubuntu:/usr/local/hadoop$ hadoop dfs -ls

Mar 16, 2018 in Big Data Hadoop by nitinrawat895
• 11,380 points
4,234 views

1 answer to this question.

0 votes

In your case there is no difference between the two commands because it looks like that you set /usr/local/hadoop/bin as HADOOP_HOME path in the .bashrc file.

Since in unix we can execute an executable file in two ways, either by giving the absolute/relative path or commands in system's executable path. 

So, when you execute - "bin/hadoop dfs -ls" , it will take you inside the directory /usr/local/hadoop. If you remove the HADOOP_HOME path from the .bashrc file, then you will not get the same result.

answered Mar 16, 2018 by kurt_cobain
• 9,390 points
スーパーコピーブランド専門ショップ時計 バッグ 財布N級品販売通販
全品送料無料!!
弊社は価値をつけてルイヴィトンを販売して、シャネル
、グッチなど。
◆2019年は最も新型に人気があって、新しい素材の商品到着! 人気ブランド品大注目
◆信用の第1、風格は多くて、品質は良いです!
◆運賃の無料(日本全国)が予約購入することを期待しています!
◆弊社の商品は絶対的な自信があります。
ぜひ、見てくださいね!!
海外スーパーコピーのスーパーコピー バッグ、アクセサリー
スーパーコピー時計、貴金属の(リサイクル品)のスーパーコピー販売買取
正規品と同等品質のコピー品 https://www.yutee007.com/protype/list-223.html

Related Questions In Big Data Hadoop

0 votes
2 answers

start-dfs.sh command is not starting Hadoop JobTracker & TaskTracker

On which version of hadoop do you ...READ MORE

answered Jul 24, 2019 in Big Data Hadoop by Lokesh Singh
3,375 views
0 votes
1 answer

The file exists before processing with hadoop command

Took session and it got resolved. READ MORE

answered Dec 18, 2017 in Big Data Hadoop by Sudhir
• 1,610 points
801 views
+1 vote
1 answer
0 votes
1 answer

Hadoop: TaskTracker and JobTracker don't start with start-dfs.sh

You must run the start-dfs..sh too. So when ...READ MORE

answered Apr 4, 2018 in Big Data Hadoop by kurt_cobain
• 9,390 points
1,145 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
10,523 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
103,822 views
0 votes
1 answer
+1 vote
1 answer

Where to set hadoop.tmp.dir? core-site.xml or hdfs-site.xml?

hadoop.tmp.dir (A base for other temporary directories) is ...READ MORE

answered Mar 26, 2018 in Big Data Hadoop by nitinrawat895
• 11,380 points
8,435 views
+2 votes
10 answers

Is there any difference between “hdfs dfs” and “hadoop fs” shell commands?

hadoop fs <args> fs is used for generic ...READ MORE

answered Mar 16, 2018 in Big Data Hadoop by anonymous
32,409 views
0 votes
1 answer

hadoop: command not found

The reason you are getting hadoop as ...READ MORE

answered Mar 28, 2018 in Big Data Hadoop by kurt_cobain
• 9,390 points
13,263 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