3 ms·
>* cat file | cmd vs. cmd < file* I tend to prefer the cat version as the flow of the command follows the left-to-right direction in which I generally read, an
by dspillett 15y ago
>* cat file | cmd vs. cmd < file*
I tend to prefer the cat version as the flow of the command follows the left-to-right direction in which I generally read, and it makes things easier for less experienced users to read and understand for the same reason.
It does make things less efficient of course, as there is at least one extra memory-copy of everything and extra process context switching, but in most cases your drives or network are the bottleneck not CPU speed or memory bandwidth. Also, when working on the command line you can drop in useful tools like pv in place of cat.
- veyron 15y agoIf you want left to right you can do <file cmd