"ls" command = "bus error" in Terminal?

Posted:
in Genius Bar edited January 2014
"ls" command = "bus error" in Terminal?



I can't seem to use the "ls" command anymore in Panther's terminal.app. I get a "bus error" message.



BUT...



I CAN use the "ls" command in X11 with no problems. Both the teminal.app and X11 use the same shell (sh-2.05b$ )





Any ideas?

Comments

  • Reply 1 of 7
    wmfwmf Posts: 1,164member
    Type "which ls" in each shell; they may have different PATHs and thus be finding different versions of ls. (I have Darwin ls and GNU ls on my computer, since the GNU version has extra options.)



    Or maybe the environment is different in a way that causes ls to crash.
  • Reply 2 of 7
    OK. I ran "which ls"



    The Terminal.App's ls is pathed to here:



    sw/bin/ls





    X11's ls is pathed to here:



    /bin/ls



    hmmmm.



    What are my options?
  • Reply 3 of 7
    kickahakickaha Posts: 8,760member
    /sw/bin is from fink, right?



    It looks like fink set up your path to look to its versions of items (such as ls) before the default built in ones. You'll have to reset the path, or alias ls to /bin/ls directly.



    Aliasing is probably easiest... place the following line in your .bash_login file:



    alias ls '/bin/ls'
  • Reply 4 of 7
    wmfwmf Posts: 1,164member
    I would just delete /sw/bin/ls.
  • Reply 5 of 7
    Quote:

    Originally posted by wmf

    I would just delete /sw/bin/ls.



    That worked...
  • Reply 6 of 7
    Quote:

    Originally posted by Kickaha

    /sw/bin is from fink, right?



    It looks like fink set up your path to look to its versions of items (such as ls) before the default built in ones. You'll have to reset the path, or alias ls to /bin/ls directly.



    Aliasing is probably easiest... place the following line in your .bash_login file:



    alias ls '/bin/ls'




    Should my .bash_login file be at the root of my home folder? (~/)?



    If I don't have one, can I create it?
  • Reply 7 of 7
    thuh freakthuh freak Posts: 2,664member
    its generally a bad idea to mess around with /sw/, like deleting files. the fink system may not react well to it. i think it would be best to re-install ls from fink. You can do this like so: 'sudo apt-get reinstall fileutils'. If the new ls doesn't work (to test it out, in any terminal, type /sw/bin/ls, instead of ls), you can do 'sudo apt-get remove fileutils'. If it doesn't work, you can try installing it from source (this part requires the dev tools). 'sudo fink reinstall fileutils'. That will download the source code, compile it, then install it. Assuming you have dev tools, that installer should really work.
Sign In or Register to comment.