Skip to content

Instantly share code, notes, and snippets.

@lights0123
Created January 10, 2016 21:46
Show Gist options
  • Save lights0123/2a03d88f99fbbdfc8a35 to your computer and use it in GitHub Desktop.
Save lights0123/2a03d88f99fbbdfc8a35 to your computer and use it in GitHub Desktop.
Replaces Terminal with a working copy
cd /tmp
rm -rf TERMINALRESTORE
mkdir TERMINALRESTORE
cd TERMINALRESTORE
curl -ORL http://swcdn.apple.com/content/downloads/21/09/031-20634/8d84o1ky5gn2agnf5kiz9eed134n7y3q4c/RecoveryHDUpdate.pkg
xar -xf RecoveryHDUpdate.pkg
hdiutil attach -nobrowse RecoveryHDMeta.dmg
hdiutil attach -nobrowse "/Volumes/Recovery HD Update/BaseSystem.dmg"
sudo rm -rf /Applications/Terminal.app # Erase the old Terminal app. Password required.
sudo cp -Rp "/Volumes/OS X Base System/Applications/Utilities/Terminal.app" /Applications/Utilities/Terminal.app # Copy over the new Terminal app
hdiutil detach "/Volumes/OS X Base System"
hdiutil detach "/Volumes/Recovery HD Update"
cd ~
rm -rf /tmp/TERMINALRESTORE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment