← All commands
Topic hub PowerShell Equivalents
Windows Linux PowerShell Equivalents Users & Groups

Windows PowerShell Add-LocalGroupMember equivalent in Linux

Adds an existing user to a supplementary group.

Windows PowerShell Add-LocalGroupMember
Linux equivalents
Debian/Ubuntu same command
sudo usermod -aG GROUP USER
Fedora same command
sudo usermod -aG GROUP USER
Arch same command
sudo usermod -aG GROUP USER

Overview

What this command does

Adds an existing user to a supplementary group.

Migration tip: The -a flag is essential: it appends the group instead of replacing all existing supplementary memberships.

Practical tasks

Common use cases

Add a user to a group

Adds an existing user to a supplementary group.

sudo usermod -aG wheel alice

Add Alice to wheel

sudo usermod -aG docker alice

Add Alice to Docker group

groups alice

Verify memberships

Ready to run

Copyable Linux commands

Review paths, device names, package names and permissions before running any command.

sudo usermod -aG wheel alice
sudo usermod -aG docker alice
groups alice

Walkthrough

Examples with explanations

sudo usermod -aG wheel alice # add a user to wheel
sudo usermod -aG docker alice # add a user to the Docker group
groups alice # verify the result

Reference

Common options and variations

Command or optionUse
sudo usermod -aG wheel aliceAdd Alice to wheel
sudo usermod -aG docker aliceAdd Alice to Docker group
groups aliceVerify memberships

Distro differences

Debian/Ubuntu vs Fedora vs Arch

This command is the same on Debian/Ubuntu, Fedora and Arch Linux when the relevant tool is installed.

DistributionPackage manager / baseEquivalent commandDifference to notice
Debian/Ubuntu same command sudo usermod -aG GROUP USER Same command on this distribution.
Fedora same command sudo usermod -aG GROUP USER Same command on this distribution.
Arch same command sudo usermod -aG GROUP USER Same command on this distribution.

Important

What to watch out for

Omitting -a can remove the user from other supplementary groups.

Keep learning

Related PowerShell Equivalents commands