Thursday, July 19, 2012

"ls command not found" in linux

I want to set environment variables in my linux environment and hence I updated .bash_profile with two lines at the end of the file.

export JAVA_HOME=/u01/app/Oracle/Middleware/jrockit_160_29_D1.2.0-10/bin/java
export PATH=/u01/app/Oracle/Middleware/jrockit_160_29_D1.2.0-10/bin

After sometime I had rebooted machine for something else and I am seeing a different screen after logging into linux system, an xclock and xterm stuff which was very unusual.

Later I noticed that ls and other bash commands are also not working as non-root user for which I modified the .bash_profile. See the error message given below.

-bash: ls: command not found
 
So I logged in as root user and modified the non-root user .bash_profile to include the actual PATH as shown below.

export PATH=$PATH:/u01/app/Oracle/Middleware/jrockit_160_29_D1.2.0-10/bin
Actually the PATH variable was earlier set as shown below.
PATH=$PATH:$HOME/bin

I rebooted machine and it works fine!! A silly mistake killed my time :(


No comments:

Post a Comment