Thursday, January 3, 2013

Recovering your deleted bash file (/bin/bash) in Unix/Linux

Recently my co-worker screwed up the bash file(/bin/bash) on his linux system.After a bit of research we found out a way to recover the bash file and get the system back to the "normal" state.Here is what we did

1. Opened a terminal.

2. Removed the overwritten(or screwed up) bash file
sudo rm /bin/bash

3. Created a soft(symbolic) link 
ln -s /bin/sh /bin/bash

4. Re-installed the bash again using apt-get
apt-get install --reinstall bash

5. Closed the terminal/console and opened a new one.

Done!!! We got the system back to its "normal" state.

Thought of sharing this with you guys just in case this happens with you.



No comments: