This question already has an answer here:
- Group files in some folders 5 answers
I have manage to grab some data of a couple of hdd with photorec, but I can't figure out how the files are saved, and it not very convenient searching in those
recup_dir.*. So my thought is to categorize by file endings. So all *.gif end up in
/home/mike/photorec/12gb/sorted/gif or something like that. But I don't know how to search the root catalog, grab the file extension and move/cp to that folder (and if not present, create the folder).
This way I can just delete unnecessary folders/files like
Lets say I have three folders:
~/photorec/80gb ~/photorec/120gb ~/photorec/100gb
Photorec creates a large amount of folder naming
recup_dir.2 etc. like:
. ├── recup_dir.1 ├── recup_dir.10 ├── recup_dir.11 ├── recup_dir.12 └── recup_dir.9 ├── f21750248.jpg ├── f21750275.gif ├── f21750277.gif ├── f21750281.gif ├── f21750296.jpg
I want to
cd 80gb, run a command or execute a bash script inside
~/photorec/80gb/ so that a new folder is created,
sorted, and inside sorted I get all files from
recup_dirs, sorted by the found files extensions.
. ├── recup_dir.1 ├── recup_dir.10 ├── recup_dir.11 ├── recup_dir.12 ├── sorted ├── gif ├── f21750275.gif ├── f21750277.gif ├── f21750281.gif ├── jpg ├── f21750248.jpg ├── f21750296.jpg
How can I achieve this?
Edit: This is not just photorec. It could be any folder ofc.