clear old output in login screen?

Matt Emmerton matt at
Mon May 4 03:21:52 UTC 2009

0> jw <jwdevel at> wrote:
>> On Sun, May 3, 2009 at 1:51 PM, Paul B. Mahol <onemda at> wrote:
>> > echo $TERM | grep cons25 >> /dev/null && clear && vidcontrol -C
>> Aha! I didn't know about 'vidcontrol -C'
>> That combined with 'clear' does the trick.
>> However...
>> Is there any way I could have this execute when the "login:"
>> prompt displays, rather than having each user need to do it
>> themselves?
>> In other words, I want this clearing to happen for all users
>> regardless of shell, etc.
> If I needed to do this, could not find a way to do it via
> configuration settings, and didn't want to hack the login
> source code, I would try renaming the login binary to
> something like login.real, and replacing it with an
> executable script containing something like:
>  #!/bin/csh
>  clear
>  vidcontrol -C
>  exec /usr/bin/login.real "$@"
> Granted such a hack will need to be redone any time you do
> an installworld.

The solution I've deployed in my environment is to have /etc/issue contain a 
single ^L character.
Prior to doing that, /etc/issue contained 25+ blank lines, which effectively 
cleared the terminal before displaying the login prompt.

Matt Emmerton 

More information about the freebsd-questions mailing list