Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I don't know if there's a program that does exactly what you want, but I know how to create a shell script that has that effect. First, see if you have ~/bin in your home directory; it's on your path, but isn't created by default. If not, create it. Then, use your favorite editor to create the following file and store it as ~/bin/tailf (for tail fold):

!# /bin/bash

tail $1 |more

Then use chmod a+x ~/bin/tailf to make it executable. (If you're doing this in a GUI from your file manager, just go into the Properties and mark it as executable.) Then, you can use tailf $FILE to get your output properly folded. Yes, using more for so few lines is a bit of overkill, but as long as it does what you want, who cares? And, it follows the Unix/Linux philosophy of chaining together several small utilities instead of writing custom programs for odd jobs like this.