In Mac's terminal, while trying to delete an uncompressed file, I accidentally deleted most of my /usr/local/bin including bash. While searching for solutions to undo the damage, I found that most of the answers involved using bash. Is there a way to restore them without using bash or a place to download precompiled bash binaries?

  • 1
    Time Machine's good for that kind of thing; or Backblaze, or ... – Tetsujin May 5 '19 at 7:18
  • @dsstorefile1 I don't think so. My computer has all kind of stuff installed and I don't want to waste them. – user963863 May 5 '19 at 15:32
  • @Tetsujin Excuse me, but sorry I don't have backup – user963863 May 5 '19 at 15:32
  • Then that will be your simplest recourse. – Tetsujin May 5 '19 at 15:33
  • How did those files get into /usr/local/bin? Homebrew or Ports? I'd start there. Check that... I'd start by either getting an ext HD and scheduling Time Machine or even better paying for a service like Backblaze, then restoring your binaries via brew or ports. – MMB May 6 '19 at 7:59

Turns out I was being stupid. The copy I had in /usr/local/bin was by homebrew, and my default shell was still protected in /bin. Yay!

If anyone finds themselves in a similar situation, then see if your precious shell is in /bin!

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy