Languages
[Edit]
EN

Bash - list current user groups in Linux

5 points
Created by:
JustMike
3518

In this short article we would like to show how to list groups for current user in Linux using Command Line.

Quick solution:

groups

Example output

john sudo cdrom

Explanation: we run command on Debian Linux, with logged-in john user, and he was assigned to john, sudo and cdrom groups.

Example screenshot:

Current user groups in Linux displayed in Bash.
Current user groups in Linux displayed in Bash.

 

Hey 👋
Would you like to know what we do?
  • Dirask is a friendly IT community for learners, professionals and hobbyists to share their knowledge and help each other in extraordinary easy way.
  • We welcome everyone,
    no matter what the experience,
    no matter how basic the question is,
    this community will help you.