tty(1) on Solnix vs Linux and the BSDs
On Solnix, tty is the illumos /usr/bin/tty. It prints the terminal name and, unlike Linux and the BSDs, has an -l option that prints the synchronous line number. The exit status meanings (0 terminal, 1 not a terminal, >1 error) match the BSD pages.
The manual pages
- Solnix: tty(1) from
pkgs.solnix.illumos-world-man· illumos.org - Linux: tty(1) coreutils-full-9.11
- FreeBSD: tty(1) 15.1-RELEASE
- OpenBSD: tty(1) 8.0
- NetBSD: tty(1) 11.0
- Standard: POSIX.1-2024 (IEEE Std 1003.1-2024),
tty
What Solnix runs
A default Solnix system runs the illumos /usr/bin/tty. No other variants are shipped. The Solnix page also documents a ksh93 tty built-in, which has long options --line-number and --silent|quiet and prints "not a tty" when standard input is not a terminal.
Differences
| Compared with | Topic | What differs |
|---|---|---|
| all four | -l option | Solnix /usr/bin/tty has -l, which prints the synchronous line number if the terminal is on an active synchronous line. The Linux, FreeBSD, OpenBSD and NetBSD pages document only -s (Linux also --help and --version).Source: Solnix tty(1) SYNOPSIS, OPTIONS /usr/bin/tty -l; Linux tty(1) DESCRIPTION; FreeBSD/OpenBSD/NetBSD tty(1) SYNOPSIS |
| Linux | long options | Linux tty accepts --silent, --quiet, --help and --version. The Solnix /usr/bin/tty page lists only -l and -s. Long options (--line-number, --silent|quiet) are documented only for the ksh93 built-in.Source: Linux tty(1) DESCRIPTION; Solnix tty(1) SYNOPSIS, OPTIONS ksh93 |
| FreeBSD, OpenBSD, NetBSD | "not a tty" message | The BSD pages say tty writes "not a tty" when standard input is not a terminal. The Solnix /usr/bin/tty page does not say this. It documents the message only for the ksh93 built-in, so scripts should not parse for it.Source: FreeBSD/OpenBSD/NetBSD tty(1) DESCRIPTION; Solnix tty(1) DESCRIPTION ksh93 |
| Linux | "not a tty" and exit status documentation | The Linux page does not document the "not a tty" message or the exit status values. The Solnix page documents 0 for a terminal, 1 for not a terminal and >1 for an error. Source: Linux tty(1) DESCRIPTION; Solnix tty(1) EXIT STATUS |
| FreeBSD, OpenBSD, NetBSD | -s deprecation | The BSD pages call -s deprecated in favour of test -t 0. The Solnix /usr/bin/tty page does not call -s deprecated. It says -s is useful only when you want the exit status, and recommends test -t. The Solnix ksh93 text recommends [[ -t 0 ]].Source: FreeBSD/OpenBSD/NetBSD tty(1) -s; Solnix tty(1) NOTES, OPTIONS ksh93 -s |
| FreeBSD, OpenBSD, NetBSD | -s and path names | Solnix says -s does not rely on the ability to form a valid path name. The BSD pages do not say this.Source: Solnix tty(1) NOTES; FreeBSD/OpenBSD/NetBSD tty(1) -s |
| all four | environment variables | The Solnix page lists LANG, LC_ALL, LC_CTYPE, LC_MESSAGES and NLSPATH as affecting tty. The Linux and BSD pages in the bundle have no environment section. Source: Solnix tty(1) ENVIRONMENT VARIABLES; Linux/FreeBSD/OpenBSD/NetBSD tty(1) |
Standards
- POSIX: tty is a POSIX.1-2024 utility.
- Solnix: Interface Stability: Committed. The Standard attribute refers to standards(7).
- FreeBSD: The tty utility is expected to be IEEE Std 1003.2 (“POSIX.2”) compatible.
- OpenBSD: The tty utility is compliant with the IEEE Std 1003.1-2008 (“POSIX.1”) specification.
- NetBSD: The tty utility conforms to IEEE Std 1003.2-1992 (“POSIX.2”).
- Linux: The bundle's Linux page has no STANDARDS section.
Writing portable scripts
- Use test
-t0 instead of tty-sto check for a terminal. Every page in the bundle recommends it or test-t. - Do not use
-lor long options in portable scripts, and do not parse the "not a tty" message. Test the exit status (0 terminal, 1 not a terminal).
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.