Linux finger Command
finger The command is used to view detailed information about users on the local or remote system, including login name, full name, login time, idle time, and so on.
Compared with who and id the command, it provides a richer display of user information, suitable for checking other users' status on a multi-user server.
finger is a user information query tool commonly used in early Unix systems; its name comes from the idea of "pointing" to someone.
It can read a user's personal description from the /etc/passwd GECOS field and display their login status.
Although for security reasons modern Linux distributions no longer install it by default finger, it still has practical value in intranet environments and teaching scenarios.
fingerThe system needs to run thefingerdservice to query remote user information. For security reasons, most public servers have disabled it.
Command syntax
finger The basic syntax is as follows:
finger [选项] [用户@主机]
If no arguments are given, a summary of all currently logged-in users is listed.
If a user name is specified, detailed information for that user is displayed.
specified 用户@主机 The format can query user information on a remote host.
finger The common options are summarized below:
| Option | Function | Example |
|---|---|---|
-s |
Display user information in short format | finger -s |
-l |
Display user information in detailed long format | finger -l runoob |
-p |
Do not display the contents of .plan and .project files | finger -p runoob |
-m |
Disable matching lookups on user names | finger -m runoob |
Detailed usage
View currently logged-in users
Running without arguments finger, it lists a summary of all logged-in users on the system.
# View all currently logged-in users
$ finger
Login Name Tty Idle Login Time Office Office Phone
root root tty1 May 19 09:00
runoob Zhang San pts/0 3 May 19 10:30 A-301 010-12345678
The output includes the login name, full name, terminal, idle time, login time, office, and phone number.
View detailed information for a specified user
Specifying a user name lets you view the complete information for that user.
# View detailed information of the runoob user
$ finger runoob
Login: runoob Name: Zhang San
Directory: /home/runoob Shell: /bin/bash
Office: A-301, 010-12345678 Home Phone: 010-87654321
Last login Tue May 19 10:30 (CST) on pts/0
Mail last read Tue May 19 09:00 2026 (CST)
No Plan.
The details include the user's home directory, default Shell, last login time, mail read time, and so on.
"No Plan." indicates that there is no
.planfile in the user's home directory; once it is created, its contents will be displayed here to show a personal profile or current status.
Short format output
Use -s The option outputs only key fields, suitable for a quick look.
# View user info in brief format
$ finger -s runoob
Login Name Tty Idle Login Time Office Office Phone
runoob Zhang San pts/0 3 May 19 10:30 A-301 010-12345678
The short format omits details such as the home directory, Shell, and last login time, producing a single-line table.
Disable fuzzy matching
By default,finger attempts to match all user names, full names, and other information containing the specified string.-m can disable this behavior and match only the exact user name.
# Exact match username, do not search full name or other fields
$ finger -m runoob
When there are full names or aliases similar to the target user name in the system,-m can avoid returning unexpected results.
View multiple users
You can specify multiple user names at once to view information for several users.
# View multiple users
$ finger runoob root
Login: runoob Name: Zhang San
Directory: /home/runoob Shell: /bin/bash
Office: A-301, 010-12345678 Home Phone: 010-87654321
Last login Tue May 19 10:30 (CST) on pts/0
No Plan.
Login: root Name: root
Directory: /root Shell: /bin/bash
Last login Tue May 19 09:00 (CST) on tty1
No Plan.
View remote user information
finger supports querying users on a remote host, in the format 用户名@主机地址.
# View user information on a remote host (requires fingerd service to be enabled on the remote host)
$ finger runoob@192.168.1.100
Login: runoob Name: Zhang San
Directory: /home/runoob Shell: /bin/bash
Last login Tue May 19 08:00 (CST) on pts/1
No Plan.
Remote queries require the target host to run
fingerd(the finger daemon) with port 79 open to the outside. Most cloud servers have disabled this feature for security reasons.
Configure .plan and .project files
Users can create .plan and .project files in their home directory to display personalized information.
# Create .project file (single-line project description)
$ echo "RUNOOB Platform Development" > ~/.project
# Create .plan file (multi-line plan or summary)
$ cat > ~/.plan << 'EOF'
当前任务:
1. 负责 RUNOOB 后端 API 开发
2. 维护数据库迁移脚本
3. Code Review 本周三之前完成
EOF
# 再次查看用户信息
$ finger runoob
Login: runoob Name: Zhang San
Directory: /home/runoob Shell: /bin/bash
Office: A-301, 010-12345678 Home Phone: 010-87654321
Last login Tue May 19 10:30 (CST) on pts/0
Project: RUNOOB Platform Development
Plan:
当前任务:
1. 负责 RUNOOB 后端 API 开发
2. 维护数据库迁移脚本
3. Code Review 本周三之前完成
.project file contents are displayed as a single line,.plan file contents can span multiple lines, suitable for a personal profile or current work tasks.
.plan The extra default indentation is for alignment; to remove it, add a blank line before the content.
Differences from the who and w commands
| Command | Richness of information | Main Use | Typical scenario |
|---|---|---|---|
who |
Basics | lists only logged-in users, terminals, and login times | Quickly check who is online |
w |
Medium | Displays logged-in users and currently running programs | See what users are currently doing |
finger |
Detailed | Displays complete user information (including contact details, plans, and so on) | View a detailed profile of a user |
Common questions
Modern Linux distributions (such as Ubuntu, Debian, and CentOS) do not install it by default;
fingeryou need to run the install command manuallyapt install fingeroryum install fingerto install it.
fingerIts installation and use may pose security risks: it exposes users' personal information and login status. Before using it on an enterprise server, make sure the security policy allows it.
finger The displayed office, phone, and other information comes from the GECOS field and can be modified with the chfn command.
If both the finger If no user information is displayed, check /etc/passwd whether the user entry exists and whether permissions are sufficient.
Related commands
| Command | Function |
|---|---|
who |
Display currently logged-in users |
w |
Display logged-in users and their current activity |
id |
Display a user's UID, GID, and groups |
chfn |
Modify a user's finger information (full name, phone, and so on) |
users |
Display currently logged-in users in a concise list |
last |
Display a user's recent login records |
Linux Command Reference