This question already has an answer here:
The problem is I have some database dumps which are either compressed or in plain text. There is no difference in file extension etc. Using
zcat on uncompressed files produces an error instead of the output.
Is there maybe another
cat sort of tool that is smart enough to detect what type of input it gets?