Edited bashrc in RHEL5 results in command not found for user

Solution Verified - Updated -

Issue

  • problem with PATH in bash:
# /bin/echo $PATH 
/usr/java/jre1.5.0_18/bin:PATH:/root/bin 
  • expected results:

    # /bin/echo $PATH
     /usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
    
  • ran the following commands to update the environment variables:

    # cd /root.  
    # echo JAVA_HOME=/usr/java/jre1.5.0_18 >> .bashrc
    # echo PATH=/usr/java/jre1.5.0_18/bin:$PATH >> .bashrc
    # echo export JAVA_HOME PATH >> .bashrc.
    
  • now nothing is working for commands:

    # ls
    -bash: ls: command not found 
    

Environment

  • Red Hat Enterprise Linux 5

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content