MacOS – output of the who command

command linemacosterminal

I am trying to understand the output of the who command. When I add the -H flag to print the headers, the second column ( the one signifying the users logged in) is titled LINE. I am trying to understand what LINE is. I am logged into my computer twice, according to the who command, but one of the lines is bad. To understand what that means, I would like to know what LINE is.

Best Answer

LINE indicates the TTY the process is running on. It is correct about you being logged into your computer twice, as you are logged in once to Cocoa (the OS X desktop), console, full path: /dev/console, and again in the terminal, ttysXXX, full path: /dev/ttysXXX (where "XXX" is a three-digit number, starting from 001).

console is Darwin's (OS X kernel) only 'real' TTY, the only one that isn't running in a terminal emulator. console, being the only non-emulated TTY is therefore the only one GUIs can run on.

The Apple logo that appears when Cocoa is not running (booting and shut-down) is generated by the kernel except when in verbose mode (start the Mac with the boot argument -V either by holding ctrl-V while booting or running nvram boot-args="-v" as root, however that will make your Mac always boot in verbose mode until you run nvram boot-args="" or clear nvram).

When boot in verbose mode instead of an Apple logo the kernel will log any boot messages and related to /dev/console and anything written to /dev/console will show up on the console and therefore on-screen (since nothing is generating a GUI on it, whether that be Cocoa or the Kernel). The main part of this is how other Unix-like/POSIX systems work.

I know this answer is kind of crappy but I hope it helps.