Ubuntu: hadoop command not found

I am trying to check my installation of hadoop. I did create the environment variables and when I call printenv , I do see my HADOOP_HOME and PATH variables printed and correct (home/hadoop and HADOOP_HOME/bin respectively). If I go to home/hadoop in the terminal and call ls , I see the hadoop file there. If I try to run it by calling hadoop , it still tells me command not found. First day on Linux, so there may be a stupid answer to this problem.

asked Apr 21, 2015 at 8:27 Alexis Eggermont Alexis Eggermont 8,125 25 25 gold badges 62 62 silver badges 94 94 bronze badges

Please show exactly what you get from printenv, because both things you've posted are wrong as written.

Commented Apr 21, 2015 at 8:30

6 Answers 6

Your current working directory is probably not part of your path. That is default on linux systems.

If you are in the same directory, where your hadoop file is, run that command with an relative path, like: ./hadoop

answered Apr 21, 2015 at 8:59 13.4k 16 16 gold badges 70 70 silver badges 110 110 bronze badges

When I extracted the hadoop zipped file, there were no file under the name hadoop . I downloaded the version 2.6.0

Commented Jan 8, 2016 at 8:05

HOME DIRECTORY:

/home/hadoop is a home directory created by linux similar to Document and settings in windows.

Open your terminal and type:

ls -l /home/hadoop 

Post your result for this command: ls -l /home/hadoop

SETTING GLOBAL PATH:

Go to /home/hadoop and open .bashrc in text editor. Add these lines at the end:

export HADOOP_HOME=/path/to/your/hadoop/installation/folder export PATH=$PATH:$HADOOP_HOME/bin 

Save and exit. Now type, this in your teminal:

echo $PATH echo $HADOOP_HOME 

If these commands shows correct directories, try hadoop command. It should work.

Post your result for these command: echo $PATH and echo $HADOOP_HOME

answered Apr 21, 2015 at 10:50 2,564 1 1 gold badge 14 14 silver badges 17 17 bronze badges

I am just trying to set up hadoop on my ubuntu machine and I was following this link tutorial. After modifying the configuration files mentioned in the tutorial, when I run hadoop version it still gives me hadoop: command not found . The results for the commands posted in this answer are in the following comment.

Commented Jan 8, 2016 at 7:31

ls -l /home/hadoop total 44 drwxr-xr-x 2 hadoop hadoop 4096 ජන 7 13:20 Desktop drwxr-xr-x 2 hadoop hadoop 4096 ජන 7 13:20 Documents drwxr-xr-x 2 hadoop hadoop 4096 ජන 7 13:20 Downloads -rw-r--r-- 1 hadoop hadoop 8980 ජන 7 13:19 examples.desktop drwxr-xr-x 2 hadoop hadoop 4096 ජන 7 13:20 Music drwxr-xr-x 2 hadoop hadoop 4096 ජන 7 13:20 Pictures drwxr-xr-x 2 hadoop hadoop 4096 ජන 7 13:20 Public drwxr-xr-x 2 hadoop hadoop 4096 ජන 7 13:20 Templates drwxr-xr-x 2 hadoop hadoop 4096 ජන 7 13:20 Videos

Commented Jan 8, 2016 at 7:35

echo $PATH /usr/local/hadoop/sbin$ echo $PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/local/hadoop/sbin:/usr/local/hadoop/bin:/usr/local/hadoop/sbin:/usr/local/hadoop/bin echo $HADOOP_HOME /usr/local/hadoop