除了回音之外,我还可以问一问,是否有一种方法可以对文件进行猫化并检索字符串,然后使用它通过base64进行解码?
此命令起作用
echo "dctyGqLcE5s+D3gzO9pxQo8C+YABV7SBbfn2jamVzVc=" | base64 --decode > out.txt
我试图将字符串放在名为file.text的文本文件上,并将回显替换为cat,但似乎失败了。
echo "`cat file.txt`" | base64 --decode > out.txt
错误信息:
base64: invalid input
发布于 2021-02-16 16:49:52
用法:
man base64
base64 file.txt > encoded.txt # to encode
base64 -d encoded.txt > decoded.txt # to decode
您也可以使用
cat file.txt | base64 # to encode
cat encoded.txt | base64 -d # to decode
Note
如果得到base64: INVALID INPUT
错误,这意味着输入文件不是base64编码的文件(不能用base64解码)。示例尝试解码您的文本文件。
base64 -d file.txt
输出:
base64: invalid input
https://stackoverflow.com/questions/66228621
复制相似问题