Help, messed up my .bash_profile and ls command is not working

Discussion in 'macOS' started by phil1995, Jun 6, 2009.

  1. phil1995 macrumors member

    Joined:
    Aug 4, 2008
    #1
    I was recently trying to install the google androikd SDK and have somehow managed to mess up my .bash_profile and my commands such as ls are not working from the terminal prompt. It is giving me a command not found.

    If I type "echo $PATH" from the terminal prompt, I simply get an entry for the android SDK

    "{PATH}:/Users/phil/android-sdk-mac_x86-1.5_r2/tools"

    Can someone tell me how to add the /bin path back in so that them "ls" and other commands begin to work again?

    Thanks in advance.
     
  2. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #2
    You'll need to type full path names for executables. Use the following to get back into your bash profile to make edits.
    Code:
    /usr/bin/pico .bash_profile
    I've been in a similar situation before.
     
  3. phil1995 thread starter macrumors member

    Joined:
    Aug 4, 2008
    #3
    I can not get the /usr/bin/pico .bash_profile to work.

    If I do a /usr/bin/ls, I can see the list of files. If I do a ls in the /bin directory, I do not see the pico file.
     
  4. retroneo macrumors 6502a

    Joined:
    Apr 22, 2005
    #4
    echo $PATH
    /Library/Frameworks/Python.framework/Versions/Current/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin

    but only the Python path is in my .bash_profile
     
  5. phil1995 thread starter macrumors member

    Joined:
    Aug 4, 2008
    #5
    How can I get into edit it, PICO does not seem to work.
     
  6. phil1995 thread starter macrumors member

    Joined:
    Aug 4, 2008
    #6
    The bin directory contains the following files, but no PICO or OPEN:

    bash,cat,chmod,cp,csh,date,dd,df,domainname,echo,ed,expr,hostname,
    kill,ksh,launchctl,link,ln,ls,mkdir,mv,pax,ps,pwd,rcp,rm,rmdir,sh,sleep,stty,
    ,sync,tcsh,test,unlink,wit4path,zsh,zhs-4.3.4
     
  7. phil1995 thread starter macrumors member

    Joined:
    Aug 4, 2008
    #7
    For anyone else with this issue, I found a post on the macosx.com tech support site. Apparently, the /bin/mv .bash_profile bash_profile resets the file to original state. Hope this helps someone else.

    Thanks for your help guys.

    try this /bin/mv .bash_profile bash_profile

    It seems your $PATH went screwy when you did some "export" on the .bash_profile. effectively the /bin/mv .bash_profile bash_profile is the same as mv .bash_profile bash_profile
     
  8. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #8
    That's the contents of /bin, not /usr/bin. That's why it wasn't working for you.
     

Share This Page