The terminals listed hints that the behavior is seen with Linux: The clues are in the manual page for wall
(Solaris for instance is different):
wall
displays a message, or the contents of a file, or otherwise its
standard input, on the terminals of all currently logged in users.
Some sessions, such as wdm
, that have in the beginning of utmp(5)
ut_type
data a ':' character will not get the message from wall
.
This is done to avoid write errors.
That is, wall
uses the utmp data, looks for terminals in use (i.e., logged-in users), and writes to the associated device. Each line in the output of w
shows a (possible) terminal, recorded by the terminal in the utmp file. For instance, I am ssh'd into a server and running screen while at the same time I logged into a console. Just for completeness, I ran xterm using the -ls
(login-shell) option. Here is the output of w
:
$ w
19:53:15 up 4:08, 5 users, load average: 0.00, 0.01, 0.05
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
tom tty2 19:48 5:11 0.04s 0.02s -tcsh
tom pts/0 michener:S.0 15:51 13:18 0.35s 0.24s ssh -X thomas@b
tom pts/2 michener:S.1 16:34 2.00s 0.14s 0.00s sh -c w
tom pts/4 michener:S.3 15:52 3:59m 0.12s 0.00s /bin/sh /users/
tom pts/3 localhost:10.0 19:53 7.00s 0.03s 0.03s -tcsh
and running wall
writes to each of those TTY
devices.
However, if the terminal does not write to the utmp file, it will not be listed — and wall
will ignore it.
Now, some programs may have the feature compiled-in, but lack privileges to change it. That is why some programs are run with setgid
to the "utmp" group. Other programs (such as xterm — or gnome-terminal) may use an external program that updates utmp on their behalf.
With gnome-terminal, the feature has been deprecated due to the mindset of the gnome developers that (a) users run on a local machine, where gdm
handles login, and (b) consequently there's no distinction worth bothering about between login shells and non-login shells. That makes for some interesting bug reports:
Best Answer
The
command, which is part of ncurses, and is located in the ncurses-bin package on Debian, will completely clear the console. Is that what you want?
Brief summary of
reset
from the man page:As discussed in https://superuser.com/questions/122911/bash-reset-and-clear-commands, and as pointed out by Erik in Shell console clearing,
clear
will just clear the screen,reset
will (as bignose put it), "reset your terminal when it gets messed up by control sequences". Personally, I'm good at messing up my terminal, and when I clear it, I'm not looking to get anything back that was there before, so I just usereset
. But ymmv.