How to find out information about users in Linux

There are a few GNU tools for finding out info about the users and groups in your system. You can also grep the users in /etc/passwd and /etc/group to find out  the information you need.

Watch Free Movies

How to find out user info with id, groups and finger:

The id command displays the user’s UID and all the user’s groups and GIDs.
Syntax: id username

$ id razvan
gid=1000(razvan) groups=1000(razvan),4(adm),

The groups command also displays all the user’s groups:
Syntax: groups username

$ groups razvan
razvan : razvan adm dialout cdrom plugdev lpadmin admin sambashare

If you need to find other info, such as the login shell, full name, email address or homedir, use finger.
Syntax: finger username

You need to install finger first:

  • On Debian/Ubuntu/Linux Mint: sudo apt-get install finger
  • On Fedora/CentOS: sudo yum install finger
  • On openSUSE: sudo zypper install finger

$ finger razvan
Login: razvan Name: razvan
Directory: /home/razvan Shell: /bin/bash
No mail.
No Plan.

Or, you can grep the username in /etc/passwd and /etc/group:

$ < /etc/passwd grep razvan

$ < /etc/group grep razvan


Scroll to Top