I'm using Bash on Ubuntu on Windows to run linux commands on my windows system. It seems to work just like Ubuntu so for all intents and purposes I'm on ubuntu here I guess.
I'm trying to use strings to dump all the strings across a bunch of files in a directory/its subdirectories to a single file.
I'm using this thread as a guide
Only problem is my results will typically generate outputs that are tens of gigabytes in size (before I kill the program) that seem to come from infinite loops of copying the same files over and over again.
This is what I've tried:
> strings -e S ./* > all.bin.jp.txt
> strings -e S ./** > all.bin.jp.txt
> find . -type f -exec strings -e S {} \; >> all.jp.txt
> find ./* -type f -exec strings -e S {} \; >> all.jp.txt
> find . -type f -exec strings -e S {} \; > all.jp.txt
> for file in ./*; do strings -e S "$file" >> all.bin.txt; done
> for file in ./**; do strings -e S "$file" >> all.bin.txt; done
> for file in ./*/*; do strings -e S "$file" >> all.bin.txt; done
I don't remember which command did it but I think the last one actually finished and gave me a file that was a few gigabytes, even though it opened easily in Notepad++. But I noticed that like 70% of that file was the same line repeated over and over again.
I've run these commands INSIDE the directory I want to get all the files, and all the files from the subdirectories, from. E.g.,
Parent Directory
--Directory of Interest
---file1
---file2
---subdirectory1
------fileA1
------fileA2
---subdirectory2
------fileB1
So from Parent Directory I type cd Directory of Interest, and then I run the command, and I want everything from file1, file2, fileA1, fileA2, and fileB1 to be dumped to a single file also inside Directory of Interest, at the same level as file1 and file2.
I'm also confused about what level to execute the command at. I don't actually care where I execute the command or if the file gets placed e.g. directly inside Parent Directory - this is just what I've tried. I don't usually have trouble running strings on all files in the current directory, using commands like the below inside the directory with all the files of interest but this subdirectories thing has me stumped.
strings -e S . > all.bin.jp.txt
strings -e S *.bin > all.bin.jp.txt
Please help me! I remember this used to work when I tried it before, but I don't remember the exact command I used. I've tried it on a couple different directories with the same types of files I've used this command on before, but it won't work for any of them, so I don't know what's wrong.