nginmu
December 23rd, 2022, 07:59 PM
ok here's the command I've been using on individual files, kept in /me/c
me@skully:~/c$ sudo base64 --decode docx > docx.docx
.. where for example, docx is a plain text file containing a base64 encoding of an MS Word .docx document.
it spits out the decoded MS Word document as docx.docx which I can then open in a word processor.
I have a raft of text files in the directory, all with random placeholder names like rumple, tug, alvin, ffff, interesting, newts etc..
What I'd like to do is issue one terminal command to go through the directory and base64 decode each and every file, leaving the originals in place, and placing the decodes into their own subdirectory, each with the same filename as the original.
How would I accomplish that?
I guessed at
me@skully:~/c$ sudo base64 --decode * > ~/c/o/*
but it did not work
Could I modify something like this; https://dev.to/equiman/base64-encode-decode-multiple-files-2ol1
[edit] - got the code at the above link working.
me@skully:~/c$ sudo base64 --decode docx > docx.docx
.. where for example, docx is a plain text file containing a base64 encoding of an MS Word .docx document.
it spits out the decoded MS Word document as docx.docx which I can then open in a word processor.
I have a raft of text files in the directory, all with random placeholder names like rumple, tug, alvin, ffff, interesting, newts etc..
What I'd like to do is issue one terminal command to go through the directory and base64 decode each and every file, leaving the originals in place, and placing the decodes into their own subdirectory, each with the same filename as the original.
How would I accomplish that?
I guessed at
me@skully:~/c$ sudo base64 --decode * > ~/c/o/*
but it did not work
Could I modify something like this; https://dev.to/equiman/base64-encode-decode-multiple-files-2ol1
[edit] - got the code at the above link working.