Deleted ls

Discussion in 'macOS' started by jariev202, Jul 22, 2005.

  1. jariev202 macrumors newbie

    Joined:
    May 6, 2005
    #1
    Accidentally I deleted the file /bin/ls :( !!!!!!

    I'm using osx 10.4.2

    Anyone knows how I may recover it?

    Thanks!
     
  2. grapes911 Moderator emeritus

    grapes911

    Joined:
    Jul 28, 2003
    Location:
    Citizens Bank Park
    #2
    Here is mine. Unzip it and move it to /bin. Hope is works.
     

    Attached Files:

    • ls.zip
      File size:
      12.4 KB
      Views:
      60
  3. jariev202 thread starter macrumors newbie

    Joined:
    May 6, 2005
  4. ChrisBrightwell macrumors 68020

    ChrisBrightwell

    Joined:
    Apr 5, 2004
    Location:
    Huntsville, AL
    #4
    Here's a question ... how did you delete /bin/ls?

    For me to put symlink in /bin, I had to sudo it.
     
  5. alex_ant macrumors 68020

    alex_ant

    Joined:
    Feb 5, 2002
    Location:
    All up in your bidness
    #5
    He was probably logged in as root.

    The ability to delete the very commands that are used to control the computer - a great idea, that. I anxiously await this feature in the next generation of nuclear reactor control panels.
     
  6. risc macrumors 68030

    risc

    Joined:
    Jul 23, 2004
    Location:
    Melbourne, Australia
    #6
    If you are the kind of person that goes around deleting stuff like ls maybe you want to put

    alias rm='rm -i'
    alias mv='mv -i'

    in ~/.profile
     
  7. mkrishnan Moderator emeritus

    mkrishnan

    Joined:
    Jan 9, 2004
    Location:
    Grand Rapids, MI, USA
    #7
    I thought it was definitively resolved that the next generation of nuclear power plants would be using Windows ME for all mission-critical applications.

    Seriously, though, I remember AmigaDOS was set up so that the core sort of "built-in" commands that were equivalent to ls, mv, cp and so on, were part of the kernel or something, so that they could not be deleted in this fashion, and that only more ancillary commands were stored in its analog to the /bin folder....

    But I guess this emphasizes why you should use sudo and not log in as root, whenever humanly posssible. :D
     
  8. grapes911 Moderator emeritus

    grapes911

    Joined:
    Jul 28, 2003
    Location:
    Citizens Bank Park
    #8
    No problem. Glad to help a fellow Mac user. :D
     
  9. jariev202 thread starter macrumors newbie

    Joined:
    May 6, 2005
    #9
    I was not logged as root. I know that's really dangerous. I was doing some configurations and had to copy one file to /bin but without wanted it I did a copy to /bin/ls, not to /bin so i rewrited ls with my file :(

    This important system commands should be part of the kernel so we may not delete them!

    Thanks again from helping me, something like this may arrive to everybody

    :cool:
     
  10. Linkjeniero macrumors 6502

    Joined:
    Jan 6, 2005
    #10
    I don't understand why is everyone so eager to take flexibility away... that's what makes UNIX so good! If you want to make sure you won't accidentally erase some file, just set the appropiate permissions (and all those really important files are owned by the root; if you managed to overwrite ls without being root, then the permissions were wrong).
     
  11. xisforextreme macrumors member

    xisforextreme

    Joined:
    Nov 5, 2004
    Location:
    Kuala Lumpur, Malaysia
    #11
    it's a surprisingly easy mistake to make, I once accidentally deleted system preferences.app. hehe, too bad mac osx isn't idiot-proof enough for me :rolleyes:
     
  12. risc macrumors 68030

    risc

    Joined:
    Jul 23, 2004
    Location:
    Melbourne, Australia
    #12
    better add

    alias cp='cp -i'

    or maybe cp -n

    to my list above then ;)

    That's not what a kernel is. This is mistake made by an inexperienced user nothing more. Maybe Apple should make the aliases part of your .profile by default, but I guess they think if you need to open the terminal you know how to use it?

    All you needed to do to fix this yourself was to reinstall BaseSystem.pkg.
     

Share This Page