^L while tail -f is running

1

I frequently use tail to monitor errors:

tail -f /var/log/apache2/error_log

I can use the shortcut cmd+K to clear the screen (OSX), but I've grown accustomed to using ^L in other linuxy situations. When I attempt to use it while tail is monitoring a file, I see output ^L instead:

[Fri Sep 30 12:08:58 2011] [notice] Apache/2.2.19 (Unix) PHP/5.3.6 with Suhosin-Patch DAV/2 mod_wsgi/3.3 Python/2.7.1 configured -- resuming normal operations
^L^L^L^L

Is there a way to get ^L to work the way i'm expecting it to in this situation?

lettertwo

Posted 2011-09-30T16:11:55.927

Reputation: 115

Answers

1

Go to System Preferences » Keyboard » Keyboard Shortcuts » Application Shortcuts and assign ^L as keyboard shortcut for the Clear Scrollback menu item in Terminal.app.

enter image description here


^L (Form Feed) is different from Clear Scrollback though if you have Terminal's scroll back enabled — the former keeps all output and just scrolls down, printing a new prompt.

Daniel Beck

Posted 2011-09-30T16:11:55.927

Reputation: 98 421

Ah I see. this works, though it changes the behavior of ^L in other situations. Is it not possible to form feed when tail is monitoring a file (since the prompt is not available, maybe)? – lettertwo – 2011-09-30T19:00:28.897