Collecting information about logged in users, boot logs, and boot failures
Linux supports commands to report aspects of the runtime system including logged in users, how long the computer has been powered on, and boot failures. This data is used to allocate resources and diagnose problems.
Getting ready
This recipe introduces the who, w, users, uptime, last, and lastb commands.
How to do it...
- The
who
command reports information about the current users:
$ who slynux pts/0 2010-09-29 05:24 (slynuxs-macbook-pro.local) slynux tty7 2010-09-29 07:08 (:0)
This output lists the login name, the TTY used by the users, login time, and remote hostname (or X display information) about logged in users.
Note
TTY (the term comes from TeleTYpewriter) is the device file associated with a text terminal that is created in /dev
when a terminal is newly spawned by the user (for example, /dev/pts/3
). The device path for the current terminal can be found out by executing the tty
command.
- The
w...