Last active
October 8, 2019 15:43
-
-
Save Kegn/9fc34ae145d1c78e35207ca71c121bf9 to your computer and use it in GitHub Desktop.
Revisions
-
Kegn revised this gist
Oct 8, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ #!/bin/bash # shitty way but works kind of # for some reason it copies them all into the first directory, so # copy the functions into a terminal then run manually # makes a list of filetypes from photorec recovery # then makes a list of files -
Kegn revised this gist
Oct 8, 2019 . 1 changed file with 4 additions and 5 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -13,11 +13,10 @@ copylist() { # makes a list list=$(ls recup**/ | grep '\.' | cut -d. -f2 | sort -u | grep -v :) # for each item in the list, call the copyfile() function on the item for item in $list; do echo $item; copyfile $item; done } @@ -26,9 +25,9 @@ copylist() { copyfile() { # make directory of recdata/filetype mkdir -p recdata/$1 # find all instances of type with relative path find . -name '*\.'$1 >> $1-file # while reading line from filetype-file, each line has a file. copy that file to the directory of filetype while IFS='' read -r line || [[ -n "$line" ]]; do cp $line recdata/$1/ ; done < $1-file } -
Kegn created this gist
Oct 8, 2019 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,36 @@ #!/bin/bash # shitty way but works kind of # for some reason it opies them all into the first directory, so # copy the functions into a terminal then run manually # makes a list of filetypes from photorec recovery # then makes a list of files # then makes directories for each one # then it copies the files into the appropriate folder # start in folder with all the recup*/ # 2019 kegn copylist() { # makes a list list=$(ls recup**/ | grep '\.' | cut -d. -f2 | sort -u | grep -v :) # for each item in the list, call the copyfile() function the item for item in $list; do echo $item; copyfile $item; done } # takes filetype as arguement copyfile() { # make directory of recdata/filetype mkdir -p recdata/$1 # file all instances of type with relative path find . -name '*\.'$1 >> $1-file # while reading line from filetype-file, each line has a file. copy that file to the directory of filetyp while IFS='' read -r line || [[ -n "$line" ]]; do cp $line recdata/$1/ ; done < $1-file } # run copylist copylist