Created
May 13, 2012 05:39
-
-
Save alghanmi/2684803 to your computer and use it in GitHub Desktop.
Recover an Accidentally Deleted Text File
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Some text available in the file | |
SAMPLE_TEXT=$1 | |
# The dev path for the media with the deleted file, e.g. /dev/sda2 | |
HDD=$2 | |
# The file used to store the output | |
RECOVERY_FILE=$3 | |
sudo grep -a -B 25 -A 100 "$SAMPLE_TEXT" $HDD > $RECOVERY_FILE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment