2

My .bashrc file before updating is as below and my Hadoop worked as well:

JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
HADOOP_INSTALL=/usr/local/hadoop
PATH=$PATH:$HADOOP_INSTALL/bin
PATH=$PATH:$HADOOP_INSTALL/sbin
HADOOP_MAPRED_HOME=$HADOOP_INSTALL
HADOOP_COMMON_HOME=$HADOOP_INSTALL
HADOOP_HDFS_HOME=$HADOOP_INSTALL
YARN_HOME=$HADOOP_INSTALL
HADOOP_COMMON_LIB_NATIVE_DIR=$HADOOP_INSTALL/lib/native
HADOOP_OPTS="-Djava.library.path=$HADOOP_INSTALL/lib"

I just added two paths as below

$ export HBASE_HOME="/home/hadoop/hbase/hbase-0.98.18-hadoop2"
PATH="$HBASE_HOME/bin:$PATH"

but most commands (as su username or clear or sudo etc.) are not working. When I wanted to change the .bashrc, I see this error:

enter image description here

How can I reach .bashrc to change it?

1
  • 3
    you don't need sudo to edit your .bashrc. – Wayne_Yux Jul 6 '16 at 7:40
3

You do not have /usr/bin in your path. To run sudo you have to type the whole path for sudo

/usr/bin/sudo nano .bashrc

If /bin is also not in your path you will specify the full path for nano like this

/usr/bin/sudo /bin/nano .bashrc

And finally you might also need to provide the path for .bashrc

/usr/bin/sudo /bin/nano ~/.bashrc

or

/usr/bin/sudo /bin/nano $HOME/.bashrc

or

/usr/bin/sudo /bin/nano /home/<username>/.bashrc

where you replace the <username> with the username that you have. And in the end you need to find out how did you manage to corrupt your $PATH.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.