f Command
Purpose
Shows user information. This command is the same as the finger command.
Syntax
Description
The f command displays information about the users who are logged in to a host. The format of the output varies with the options for the information presented.
- Default Format
-
The default format includes the following items:
- Login name
- Full username
- Terminal name
- Write status (an
*(asterisk) before the terminal name indicates that write permission is denied)
For each user on the host, the default information list also includes, if known, the following items:
- Idle time (Idle time is minutes if it is a single integer, hours, and minutes if
a :(colon) is present, or days and hours if adis present.) - Login time
- Site-specific information
The site-specific information is retrieved from the gecos field in the /etc/passwd file. The gecos field can contain the Full username followed by a comma. All information that follows the comma is displayed by the finger command with the Site-specific information.
- Longer Format
-
A longer format is used by the f command whenever a list of users names is given. (Account names, first and last names of users are accepted.) This format is multiline, and includes all the information described above along with the following:
- Users $HOME directory
- User's login shell
- Contents of the .plan file in the users $HOME directory
- Contents of the .project file in the users $HOME directory
The f command may also be used to look up users on a remote system. The format is to specify the user as User@Host. If you omit the username, the f command provides the standard format listing on the remote system.
Create the .plan and .project files by using your favorite text editor and place the files in your $HOME directory. The f command uses the toascii subroutine to convert characters outside the normal ASCII character range when displaying the contents of the .plan and .project files. The f command displays a
M-before each converted character.When you specify users with the User parameter, you can specify either the users
first name,last name, oraccount name. When you specify users, the f command, at the specified host, returns information about those users only in long format.For other information about the f command, see "Installation of TCP/IP" in Networks and communication management.
Flags
| Item | Description |
|---|---|
| -b | Gives a brief, long-form listing. |
| -f | Suppresses printing of header line on output (the first line that defines the fields that are being displayed). |
| -h | Suppresses printing of .project files on long and brief long formats. |
| -i | Gives a quick listing with idle times. |
| -l | Gives a long-form listing. |
| -m | Assumes that the User parameter specifies a user ID (used for discretionary access control), not a user login name. |
| -p | Suppresses printing of .plan files on long-form and brief long-form formats. |
| -q | Gives a quick listing. |
| -s | Gives a short format list. |
| -w | Gives a narrow, short-format list. |
Parameters
| Item | Description |
|---|---|
| @Host | Specifies all logged-in users on the remote host. |
| User | Specifies a local user ID (used for discretionary access control) or local user login name, as specified in the /etc/passwd file. |
| User@Host | Specifies a user ID on the remote host, which is displayed in long format. |
Examples
- To get information
about all users logged in to host
alcatraz, enter:
Information similar to the following is displayed:f @alcatraz
User[alcatraz.austin.ibm.com] Login Name TTY Idle When Site Info brown Bob Brown console 2d Mar 15 13:19 smith Susan Smith pts0 11: Mar 15 13:01 jones Joe Jones tty0 3 Mar 15 13:01brownis logged in at theconsole, usersmithis logged in from pseudo teletype linepts0, and userjonesis logged in fromtty0. - To get more information about user
brownatalcatraz, enter:
Information similar to the following is displayed:f brown@alcatrazLogin name: brown Directory: /home/brown Shell: /home/bin/xinit -L -n Startup On since May 8 07:13:49 on console No Plan. - To get information about user
brownat a local host in a short form, enter:
Information similar to the following is displayed:f -q brownLogin TTY When brown pts/6 Mon Dec 17 10:58
Files
| Item | Description |
|---|---|
| /usr/bin/f | This file contains the f command. |
| /etc/utmp | This file contains a list of users who are logged in. |
| /etc/passwd | Defines user accounts, names, and home directories. |
| /etc/security/passwd | Defines user passwords. |
| /var/adm/lastlog | Contains last login times. |
| $HOME/.plan | Optional file that contains a one-line description of a user's plan. |
| $HOME/.project | Optional file that contains a user's project assignment. |