Can someone explain the misuse of cat, which bat solves?
Catting a file will your terminal make interpret escape codes in the file. For instance: $ echo -e "\033]0;${USER} is an unfriendly person\007" > test-file.txt Then, many days later: $ cat test-file.txt will change your terminal title. With less, you _can_ interpret escape codes, but usually you don't, and I consider this the correct default.
An Illustrated Guide to Useful Command Line Tools
41–50 of 108 posts
Re: An Illustrated Guide to Useful Command Line Tools
#42Can someone explain the misuse of cat, which bat solves?
Catting a file will your terminal make interpret escape codes in the file. For instance: $ echo -e "\033]0;${USER} is an unfriendly person\007" > test-file.txt Then, many days later: $ cat test-file.txt will change your terminal title. With less, you _can_ interpret escape codes, but usually you don't, and I consider this the correct default.
What is clear is that
$ cat test-file.txt
does not print the initially-echoed text, but it is escaped and up to nefarious tasks.Re: An Illustrated Guide to Useful Command Line Tools
#43Re: An Illustrated Guide to Useful Command Line Tools
#44Re: An Illustrated Guide to Useful Command Line Tools
#45Can someone explain the misuse of cat, which bat solves?
Catting a file will your terminal make interpret escape codes in the file. For instance: $ echo -e "\033]0;${USER} is an unfriendly person\007" > test-file.txt Then, many days later: $ cat test-file.txt will change your terminal title. With less, you _can_ interpret escape codes, but usually you don't, and I consider this the correct default.
Re: An Illustrated Guide to Useful Command Line Tools
#46Re: An Illustrated Guide to Useful Command Line Tools
#47Amazing how many of those are written in Rust and Go.
Re: An Illustrated Guide to Useful Command Line Tools
#48ag: - silver searcher, fast parallelized recursive grep that can abide by things like `.gitignore`
fzf: - fuzzy finder
powerline-shell - $PS1 on steroids
Re: An Illustrated Guide to Useful Command Line Tools
#49Re: An Illustrated Guide to Useful Command Line Tools
#50Earlier quoted context omitted.
Catting a file will your terminal make interpret escape codes in the file. For instance: $ echo -e "\033]0;${USER} is an unfriendly person\007" > test-file.txt Then, many days later: $ cat test-file.txt will change your terminal title. With less, you _can_ interpret escape codes, but usually you don't, and I consider this the correct default.
That's a surprising and interesting bit if knowledge, thanks