Last active
November 21, 2018 14:47
-
-
Save filiperfernandes/d70b5bda962103b6b1620698cf5dfc1d to your computer and use it in GitHub Desktop.
Recover multiple files with icat
This file contains hidden or 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
# First get list of files: | |
# fls -f ext4 -o 2048 -p -r ./image_disk 573445 | grep -v '^..-' | grep -v '^... \*' > files.lst | |
IMAGE=image_disk | |
LIST=files.lst | |
DEST=/path/to/output/dir | |
cat $LIST | while read line; do | |
filetype=`echo "$line" | awk {'print $1'}` | |
filenode=`echo "$line" | awk {'print $2'}` | |
filenode=${filenode%:} | |
filename=`echo "$line" | cut -f 2 | grep -v " "` | |
if [ $filetype == "r/r" ]; then | |
echo "$filename" | |
mkdir -p "`dirname "$DEST/$filename"`" | |
icat -f ext4 -o 2048 -r -s "$IMAGE" "$filenode" > "$DEST/$filename" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment