Follow us on...
Follow us on Twitter Follow us on Facebook
Register
Results 1 to 2 of 2
  1. #1
    jbosch is offline Registered User
    Join Date
    Jun 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Angry Can't execute a simple LS command in my terminal?

    Hi,

    I have a Mac OS Lion 10.7.3, for some estrange reason, when I go to my terminal, and execute a ls command I get a "command not found error".

    I reader somewhere else in this forum about restoring a bash file or the Path. But I can't reach such file (maybe because I'm new to MAC). The fact is that if I can't execute commands, my mac is unuseless to me.

    Anyone has any idea about how to fix this? Thanks.

  2. #2
    ElDiabloConCaca's Avatar
    ElDiabloConCaca is offline U.S.D.A. Prime
    Join Date
    Aug 2001
    Location
    San Antonio, Texas
    Posts
    14,490
    Thanks
    10
    Thanked 648 Times in 610 Posts
    Try this:

    1) Open Terminal.
    2) At the prompt, type "echo $PATH" (without the quotes, of course) and press enter.
    3) Post the results of that command here.

    More than likely, you've installed some program that modified the PATH variable or modified some config file (.bashrc, .bash_profile, etc.) and accidentally put "export PATH=something" without doing "export PATH=$PATH:something" instead, completely wiping out the pre-defined PATH locations.

    Here's a quick tutorial on changing the PATH variable:

    http://www.tech-recipes.com/rx/2621/...ment_variable/

    In the meantime, you can still execute an "ls" command -- you just have to tell the Terminal where the ls program resides (hint: it should be in /bin)... instead of doing:
    Code:
    ls
    ...do this:
    Code:
    /bin/ls
    ...in the Terminal until you fix your PATH variable.
    2009 Mac mini 2.0GHz • 2010 MacBook Air 11" • 2010 MacBook Pro 13" • LED 24" Cinema Display
    PowerMac G4 MDD dual 1.25GHz • PowerMac G4 Yikes! • iPad 2 32GB • 2 x iPhone 4 16GB • iPod Touch 8GB • iPod nano 1GB • iPod shuffle 1GB • AirPort Extreme dual-band • AppleTV
    http://www.jeffhoppe.com

 

 

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •