Replies: 1 comment 2 replies
-
It's perhaps worth nothing that |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Question
I've learned about bat and I love it! One thing that bothers me is the tagline and that
bat
is described as a clone ofcat
.Surely I often use
cat
to print out a file and take a look at it, but I also use cat often to pipe a file through a chain of processes. Surely I could usedd
, but then I have to typedd if=FILE |
rather thancat FILE |
.So my usage of cat is not just to read files in the terminal.
I have also heard that the original use case for cat (and where the name comes from) was to conCATenate files, not to print them out and read. So doing
cat *.xyz > concatenated.xyz
would splice all the files together into one.Bat seems to be primarly meant for reading in the console and it behaves more like
less
thancat
in that regard.more
was intended for that purpose andless
is a better version of it.Usage of
cat
has changed and it is most often used to print out files than to concatenate them, butbat
also adds extra characters to make the reading easier (adds a header) and features pagination (likeless
).Wouldn't all that make
bat
more of a replacement forless
?Self-Answer
I have done some testing and found out that
bat
smartly disable all formatting and extra features when piping it's output to another program, making it indeed a great replacement forcat
!Beta Was this translation helpful? Give feedback.
All reactions