If I understand the cat
manual correctly:
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 command:
cat img.png > copy.png
I will obtain 2 png files identical while if I just
cat img.png
I have all chance that my terminal get messed up and misinterpret what I type.
- How's that possible?
- Binary values are still binary data. Why it does not simply shows a series of 0 and 1 or the interpretation of those binary data in ASCII or whatever the encoding in terminal is?
- Is this behavior also possible by
cat
ing a text file containing strange characters? - Should a mechanism to prevent this behavior like try{}catch{} statement should be implemented?
reset
command might help sometimes, but this is no miracle solution.reset
and areset
between Ctrl-J keypresses? I can't see any (nor any reason to go the more complicated way)