6 ms·
Don't forget to pipe head into 'cat -v'... that text file could contain _anything_!
by yrro 3y ago
Don't forget to pipe head into 'cat -v'... that text file could contain _anything_!
- gunapologist99 3y agoThank you for pointing this out! This is much safer.
- lelandbatey 3y agoI 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.
- jmhammond 3y agoMy 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.
- rconti 3y agoI hate that when I use `less`, then quit, the output goes away.
- LgWoodenBadger 3y agoYou can run "less -X" for that, but it may have other problems depending on how you use less (e.g. scrolling up, etc.)