Return user's terminal name

      tty [-s]

   -s      Don't write the terminal name; only the exit status is affected
           when this option is specified.  The -s option is deprecated in
           favor of the `test -t 0' command.    

Tty exits 0 if the standard input is a terminal, 1 if the standard input is not a terminal, and >1 if an error occurs.

“Behind every great fortune there is a crime” ~ Honore de Balzac

Related macOS commands

env - Display, set, or remove environment variables.
id - Print user and group id's.
uname - Print the Darwin OS Kernel version / release / machine name.
users - Print login names of users currently logged in.
who - Print who is currently logged in.
whoami - Print the current user id and name (`id -un').

Copyright © 1999-2024
Some rights reserved