Last Updated: February 22, 2016
·
1.447K
· lukaszkorecki

Handy ZSH hack

You know you can abuse cat and do something like:

cat file.txt

to print the file to terminal.

Probably you've used:

less file.txt

or

more file.txt

You probably also know that you can redirect a file to a command, for example:

mysql -ume -p < migration.sql

Turns out ZSH can do something like:

< file.txt

it's smart enough to view the file in a pager if it's too long to be printed in your terminal.

This doesn't work in Bash.