Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I have followed a guide online which requested me to run this command:

sudo cp /opt/local/bin/node /bin/sh

It was a guide for fixing LESS. Instead of fixing it, it only made it worse. I have lost the file.

Is there any way to recover/refetch this file, or could someone upload their sh file for me?

share|improve this question
1  
To request someone to upload their sh for you is as risky as it was to follow the receipe you did. This is trust at random :). –  daniel Azuelos Aug 26 at 11:21

1 Answer 1

up vote 5 down vote accepted

Run this command to copy /bin/sh from the BaseSystem.dmg on the Recovery HD:

diskutil mount Recovery\ HD &&
    hdiutil mount /Volumes/Recovery\ HD/com.apple.recovery.boot/BaseSystem.dmg &&
    sudo cp -p /Volumes/OS\ X\ Base\ System/bin/sh /bin/sh

Also see How can I get back a system file after deleting it from my Mac?

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.