2
votes
2answers
612 views

Why using cat on binary files messed up the terminal and how?

If I understand correctly the cat manual: concatenate files and print on the standard output cat will take files as argument and print them on standard output. What I don't get is if I use the ...
8
votes
1answer
1k views

How to store an image file in bash variable?

After I use the following command, pngString="$(cat example.png)" echo -n "$pngString" > tmp.png I can't open the tmp.png as a PNG file. Maybe some information is lost when I use $pngString ...
3
votes
2answers
148 views

Make ls distinguish scripts from binaries in output

Is it possible to make ls distinguish executable scripts from actual compiled binaries? The permissions are most often the same (+x), and with ls -F you get an asterisk suffix (*) for both, so it's ...
6
votes
2answers
662 views

What is produced after using cat on an image?

Let's say one creates a file like so: touch myFile You enter some text in it with vim or whatever, and then use cat myFile to spit the contents out into the terminal. Now, what happens when I use ...