Search code examples
linuxshellrecovery

linux oneliner to find one file with exactly 23 chars+newline (or all) in 18gb of recovered data


I have sailed the 1e100 and did the mandatory search your question. I'll keep it short cos for most of you here time IS money so. Leaving out the circumstances, i am left with 18 gb of data from testdisk recovery after total weirdness on all my pcs at once. One of those might be a mega recovery key which unfortunately i stashed in two offline and one online place and are all gone (total weirdness, nm that) I can probably script this with some thinking but my head is in explode-mode so i was wondering if any superguru here knows the oneliner to do that before i start scripting multiple lines in loops. Anything that gets through umpteen recursive dirs listing all files with exactly x characters will do fine, that should narrow it down a lot.

If not not, cant blame me for asking i hepe. Thanks in advance for your time. (im using Linux mint 18.1 mainly or openwrt on that little vocore but i can switch to anything installable for this time i suppose)


Solution

  • I see ... (how to mark as solved, mark the answer that solved it but if there is none write your own) ok

    the answer is simple, thanks to mister Benjamin W.

    go the the directory that contains all the folders you need to check (however you do, in linuxming rightclick and "open terminal" for instance)

    then theres one simple command : (for a file 22 characters in size in this case 22,no newline which i dont think matters since a newline is a character but see thats why im not good at here i go again)

    the command was "find -size 22c"

    gotta love linux (ah well, assuming you got all the directories and files under one folder and set the permissions b/c testdisk writes to locked folders so you would have to change those and thats where i start elaborating but i found i found assuming is often incomplete so im sorry for that, you also have to ... turn the computer on and press play on tape but let's assume that for once)

    nothing more , nothing less, thanks a lot and i think this site truly belongs top 10 or five in the whole ww have a nice day