9.4. Identifying Network UsersLinux networking is all about moving around the network and talking to other people. Therefore, a basic thing to learn is how to find out who's on a particular host. There are several utilities that do this, each with its own strengths:
The next few subsections describe each of these utilities in turn. 9.4.1. Listing Users: usersThe users utility (Figure 9-6) simply lists the current users of your local system.
Here's an example of users in action: $ users ...display users on the local host. glass posey $ _ 9.4.2. More User Listings: who and wThe who utility (Figure 9-7) supplies a little more information than the users utility.
Here's an example of who: $ who ... list all users currently on local host. posey pts/0 May 15 16:31 (blackfoot.utdall) glass pts/2 May 17 17:00 (bridge05.utdalla) $ _ The w utility (Figure 9-8) is just as easy to use.
Here's an example: $ w ...obtain more detailed information than who. 22:25:35 up 11 days 3 users, load average: 0.08, 0.03, 0.01 USER TTY LOGIN@ IDLE JCPU PCPU WHAT posey pts/0 22:19 2days 1 csh glass pts/2 17:48 1 13 1 w $ w glass ...examine just myself. 22:25:48 up 11 days 3 users, load average: 0.08, 0.03, 0.01 USER TTY LOGIN@ IDLE JCPU PCPU WHAT glass pts/2 17:48 1 13 1 w $ _ 9.4.3. Your Own Host Name: hostnameTo find out the name of your local host, use hostname (Figure 9-9).
Here's an example: $ hostname ...display my host's name. bluenote $ _ 9.4.4. Personal Data: FingerOnce you've obtained a list of the people on your system, it's handy to be able to learn a little bit more about them. The finger utility allows you to do this (Figure 9-10).
I recommend that you create your own ".plan" and ".project" files in your home directory so that people can "finger" you back. Have fun! In the following example, I fingered everyone on the system and then fingered myself: $ finger ...finger everyone on the system. Login Name Tty Idle Login Time Where posey John Posey pts/0 2d Fri 16:31 console In the next example, I listed the three sources of finger's information about me: $ cat .plan ...list the ".plan" file. To work hard and have fun and not notice any difference. $ cat .project ...list the ".project" file. To earn an enjoyable, honest living. $ grep glass /etc/passwd ...look at the password file. glass:x:496:62:Graham Glass:/home/glass:/bin/ksh $ _ |