Terminal Not Working Correctly

Posted:
in Genius Bar edited January 2014
Hey Everyone!



I can't get terminal to function correctly on my machine.



Simply, I can use the 'cd' command but common commands like 'ls' aren't working.. ( I get a - Command Not Found - Message)



typing echo $path returns NOTHING...



Whats going on??



THX

Andrew

Comments

  • Reply 1 of 9
    taskisstaskiss Posts: 1,212member
    try



    /bin/ls



    and if that works, you've messed up your /etc/profile somehow.



    Oh, and the variable isn't $path, it's $PATH



    ...case sensitive.



    your /etc/profile should contain:

    Code:


    # System-wide .profile for sh(1)



    PATH="/bin:/sbin:/usr/bin:/usr/sbin"

    export PATH



    if [ "${BASH-no}" != "no" ]; then

    [ -r /etc/bashrc ] && . /etc/bashrc

    fi







  • Reply 2 of 9
    Thanks for the reply! that was very helpful towards figuring out this problem.



    Now: typing /bin/ls .. works..



    and echo $PATH returns.. /usr/local/mysql/bin (duh!!)



    I should mention I'm running a MAMP server off my machine (prototyping purposes) and so since mysql is showing up in my path, did that mess terminal up somehow?



    thanks again!! ( I wish I was good enough at Unix to help people )
  • Reply 3 of 9
    MarvinMarvin Posts: 15,326moderator
    Quote:
    Originally Posted by arpowers View Post


    and echo $PATH returns.. /usr/local/mysql/bin (duh!!)



    I should mention I'm running a MAMP server off my machine (prototyping purposes) and so since mysql is showing up in my path, did that mess terminal up somehow?



    It shouldn't have but it's quite possible if one of your terminal scripts reset the path by doing something like:



    export PATH="/usr/local/mysql/bin"



    instead of:



    export PATH="$PATH:/usr/local/mysql/bin"



    Try entering open -e ~/.profile in the terminal to see if the entry is in there.
  • Reply 4 of 9
    It says "-e command not found"



    am I missing something?
  • Reply 5 of 9
    MarvinMarvin Posts: 15,326moderator
    Quote:
    Originally Posted by arpowers View Post


    It says "-e command not found"



    am I missing something?



    Sorry, I meant you type in:



    open -e ~/.profile



    You may need to use /usr/bin/open instead of open.
  • Reply 6 of 9
    Thank you for your help Marvin...



    I typed:

    open -e ~/.profile

    and got:

    open: command not found...



    then I typed:

    /usr/bin/open -e ~/.profile

    and got:

    No such file: /users/andrewpowers/.profile



    thanks in advance for any further help guys...
  • Reply 7 of 9
    MarvinMarvin Posts: 15,326moderator
    Try



    /usr/bin/open -e ~/.bashrc



    and also what Taskiss said -



    /usr/bin/open -e /etc/profile.
  • Reply 8 of 9
    Thanks again for the help guys but Its still not working correctly...







    I've attached a picture of what happens when I run all the suggested codes...

    let me know what else would be helpful.



    Thanks again...





    Quote:
    Originally Posted by Marvin View Post


    Try



    /usr/bin/open -e ~/.bashrc



    and also what Taskiss said -



    /usr/bin/open -e /etc/profile.



  • Reply 9 of 9
    Hey,

    So I had my "unix guru" friend come over and fix this for me...



    He found a bug (improperly called $PATH w/out $) in a file that MAMP installed.

    I wonder if they've fixed this?



    Thanks again..
Sign In or Register to comment.