clear(1) on Solnix vs Linux and the BSDs
On a default Solnix system, clear is the illumos /usr/bin/clear, which takes only an optional terminal-type operand and has no -x, -T or -V. The published Solnix page describes the ncurses clear (pkgs.solnix.ncurses), which behaves like Linux and FreeBSD clear and also clears the scrollback buffer.
The manual pages
What Solnix runs
The published page is the ncurses clear (pkgs.solnix.ncurses, ncurses 6.5), but the command on PATH is the illumos /usr/bin/clear. Its synopsis is `clear [term]`, with no options. /usr/ucb/clear is also shipped, but the bundle does not describe it. The ncurses clear is only reached if the pkgs.solnix.ncurses package is installed and ahead on PATH; the bundle does not say how its binary is named or placed.
Differences
| Compared with | Topic | What differs |
|---|---|---|
| Linux, FreeBSD, OpenBSD | options on the default clear | The illumos /usr/bin/clear on Solnix accepts no options, only an optional term operand. Linux, FreeBSD and OpenBSD clear (ncurses) accept -T type, -V and -x. A script calling `clear -x` or `clear -T xterm` fails or misbehaves with the Solnix default.Source: Solnix default illumos clear(1) SYNOPSIS, OPERANDS; Linux clear(1) SYNOPSIS, OPTIONS; FreeBSD clear(1) OPTIONS; OpenBSD clear(1) OPTIONS |
| Linux, FreeBSD, OpenBSD | terminal type: operand vs -T | The illumos clear takes the terminal type as a bare operand (`clear term`). The ncurses clear on Linux, FreeBSD and OpenBSD takes it with -T. The ncurses clear on Solnix also uses -T, so the syntax depends on which clear runs.Source: Solnix default illumos clear(1) OPERANDS; Linux clear(1) -T; FreeBSD clear(1) -T; OpenBSD clear(1) -T; Solnix ncurses clear(1) -T |
| Linux, FreeBSD | scrollback buffer | The ncurses clear (Linux, FreeBSD, and the Solnix ncurses page) clears the scrollback buffer too, using the E3 capability, unless -x is given. The illumos page says only that it clears the screen and mentions no scrollback or E3.Source: Linux clear(1) DESCRIPTION, -x; FreeBSD clear(1) DESCRIPTION, -x; Solnix default illumos clear(1) DESCRIPTION |
| OpenBSD | scrollback and stdout redirection | OpenBSD clear clears scrollback only if the extended E3 capability is defined. Its page also says output goes to standard output, so redirecting it to a file and later catting that file clears the screen. The illumos page does not say this. Source: OpenBSD clear(1) DESCRIPTION; Solnix default illumos clear(1) DESCRIPTION |
| Linux, FreeBSD, OpenBSD | -T and LINES/COLUMNS | With the ncurses clear, giving -T makes clear also ignore the LINES and COLUMNS environment variables. The illumos page documents no such effect.Source: Linux clear(1) -T; FreeBSD clear(1) -T; OpenBSD clear(1) -T; Solnix default illumos clear(1) OPERANDS |
| Linux, FreeBSD, OpenBSD | -V version report | The ncurses clear has -V, which reports the ncurses version and exits successfully. The illumos clear has no version option.Source: Linux clear(1) -V; FreeBSD clear(1) -V; OpenBSD clear(1) -V; Solnix default illumos clear(1) SYNOPSIS |
| NetBSD | no separate clear page | The NetBSD page is tput(1), covering both tput and clear in its NAME line. Its synopsis shows only `tput [-T term] attribute`, and clear is listed as a tput attribute (`tput clear`). It documents no -x or -V, and nothing about scrollback.Source: NetBSD clear(1) NAME, SYNOPSIS, DESCRIPTION (special attributes: clear) |
| NetBSD | exit status | The NetBSD page documents tput exit codes: 0 if the attribute is defined, 1 if not, 2 on error. The Solnix pages say nothing about clear's exit status beyond that -V exits successfully.Source: NetBSD clear(1) EXIT STATUS; Solnix ncurses clear(1) -V |
Standards
- POSIX: clear is not a POSIX.1-2024 utility.
- Solnix: The illumos clear page refers to attributes(7); the bundle shows no interface-stability table for it.
Writing portable scripts
- Do not rely on clear options. Run plain `clear` with TERM set, or use `tput clear`, which all four systems document in some form.
- If you need to keep scrollback on ncurses systems, use
-x, but guard it: the default Solnix illumos clear does not accept it.
Every difference here is taken from the manual pages linked above: Solnix's published page, Linux (man-pages and the GNU and util-linux manuals), FreeBSD, OpenBSD and NetBSD. Each row names its source. Where a manual is silent, this page is too. Compiled 2026-10-26. Found a mistake? Mail hackers@lists.solnix.io.