← Back to context

Comment by yrro

3 years ago

Don't forget to pipe head into 'cat -v'... that text file could contain _anything_!

I really recommend folks use "less" over cat, especially keyboard oriented folks. Different terminal emulators don't always have the scroll behavior I want, not do they always allow me to search the file I'm looking at. "less" does all those things, in nearly every environment no matter the terminal emulator, and has other wonderful options to boot (chop long lines so they don't wrap can be nice for logs, line numbers can be VITAL, etc).

I still uselessly use cat though, it's such a nice way to build a pipeline.

  • My useless cat is that I always use `cat file | less` when I could just `less file`.

    I've been typing cat for over 25 years. Old habits die hard.