Command Not Found - How to fix.

General support questions
Post Reply
Utsav
Posts: 13
Joined: 2016/04/16 16:46:13

Command Not Found - How to fix.

Post by Utsav » 2018/06/21 16:27:23

Dear Support,

I mistakenly edited the .bashrc with following Java Environmental settings:

Code: Select all

export JAVA_HOME=/opt/jdk1.8.0_172
export PATH=$JAVA_HOME/bin/
instead of doing this:

Code: Select all

export JAVA_HOME=/opt/jdk1.8.0_172
export PATH=$JAVA_HOME/bin:$PATH
Due to this reason, neither of command is working - Command not found for the root user.

Could you please let me know how to fix this issue. and Is there any good way on setting the Environment variables other than .bashrc

Thank you.

hunter86_bg
Posts: 2019
Joined: 2015/02/17 15:14:33
Location: Bulgaria
Contact:

Re: Command Not Found - How to fix.

Post by hunter86_bg » 2018/06/21 16:40:43

Have you tried to change your .bashrc to

Code: Select all

export JAVA_HOME=/opt/jdk1.8.0_172
export PATH=$JAVA_HOME/bin:$PATH
and then logout and login ???
If you need vim or nano , you can use:

Code: Select all

/usr/bin/vim
/usr/bin/nano
Of course you can set your path temporarily (for the root user) via:

Code: Select all

export PATH='/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin'
and for a regular non-privileged user:

Code: Select all

export PATH='/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/home/YOUR_USER/.local/bin:/home/YOUR_USER/bin'

Utsav
Posts: 13
Joined: 2016/04/16 16:46:13

Re: Command Not Found - How to fix.

Post by Utsav » 2018/06/26 16:58:24

Thank you.
This solved the Problem.

I temporarily changed the path with following suggested command

Code: Select all

export PATH='/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin'
changed the .bashrc to

Code: Select all

export JAVA_HOME=/opt/jdk1.8.0_172
export PATH=$JAVA_HOME/bin:$PATH
and finally reboot the system.

Thank you so much. :D :D :D

Post Reply