Windows net localgroup equivalent in Linux
Creates groups, adds users to groups, and lists group memberships.
net localgroup
groupadd / groups
groupadd / groups
groupadd / groups
Overview
What this command does
On Windows, "net localgroup" is used to manage user groups. On Linux, the closest practical mapping shown here is "groupadd / groups". Creates groups, adds users to groups, and lists group memberships. This reference is grouped under Security & Permissions → Users & Groups.
Windows → Linux context
What changes when you use this on Linux?
Equivalent task, different tool
Windows net localgroup maps to groupadd / groups for this task. Treat this as a workflow mapping rather than a character-for-character syntax translation.
Portable across the compared distros
The Debian/Ubuntu, Fedora and Arch rows use the same command in this mapping. Package availability or defaults can still vary, so check the installed tool version when an option behaves differently.
Command-specific caution
The -a flag in usermod -aG means 'append'. Without it, the user is removed from ALL other groups. Always use -aG together.
For the broader concept behind this mapping, read Linux permissions for Windows users.
Practical tasks
Common use cases
Manage user groups
Creates groups, adds users to groups, and lists group memberships.
groups username
List groups a user belongs to
groupadd groupname
Create a new group
usermod -aG group user
Add user to group (-a means append)
Ready to run
Copyable Linux commands
Review paths, device names, package names and permissions before running any command.
groups john
sudo groupadd developers
sudo usermod -aG developers john
sudo usermod -aG docker john
Walkthrough
Examples with explanations
# Windows: net localgroup Administrators john /add
groups john # what groups is john in?
sudo groupadd developers # create a new group
sudo usermod -aG developers john # add john to it
# Allow john to run Docker without sudo:
sudo usermod -aG docker john
(log out and back in for changes to take effect)
Reference
Common options and variations
| Command or option | Use |
|---|---|
groups username | List groups a user belongs to |
groupadd groupname | Create a new group |
usermod -aG group user | Add user to group (-a means append) |
gpasswd -d user group | Remove user from group |
cat /etc/group | List all groups on the system |
Distro differences
Debian/Ubuntu vs Fedora vs Arch
Debian/Ubuntu, Fedora and Arch all use "groupadd / groups" for this mapping. The command syntax shown here is portable across the three rows, although installed versions and system defaults can still vary.
| Distribution | Package manager / base | Equivalent command | Difference to notice |
|---|---|---|---|
| Debian/Ubuntu | same command | groupadd / groups |
Same command on this distribution. |
| Fedora | same command | groupadd / groups |
Same command on this distribution. |
| Arch | same command | groupadd / groups |
Same command on this distribution. |
Important
What to watch out for
Keep learning