3 ms·
If I didn't have manpages or the option to google I'd probably just use head or tail after doing 'wc -l' to determine line count. head filename -n `wc -l filen
by vman81 2y ago
If I didn't have manpages or the option to google I'd probably just use head or tail after doing 'wc -l' to determine line count.
head filename -n `wc -l filename`
- Calzifer 2y agoIn most cases you could simply use a huge number of lines like head filename -n 1000000000 or use the "inverse mode". Head and tail can print all but the first/last n lines (I just have trouble to remember without man page the syntax and which does what). So those are more "cat equivalents": head -n-0 filename tail -n+0 filename PS: for your wc example you could actually do just head -n $(wc -l filename) because `wc` will print the number of lines and the filename. (does not work with spaces)
- deleted 2y ago[deleted]