Forrest logo
back to the gpasswd tool

gpasswd:tldr:065e2

gpasswd: Remove a user from the named group.
$ gpasswd -d ${user} ${group}
try on your machine

The command "gpasswd -d ${user} ${group}" is used to remove a user from a group in Linux.

Here is what each part of the command represents:

  • "gpasswd" is the command itself. It is used for managing group passwords and membership.
  • "-d" is an option that stands for "delete". It is used to indicate that the user should be removed from the group.
  • "${user}" is a placeholder that needs to be replaced with the actual username of the user you want to remove from the group.
  • "${group}" is another placeholder that needs to be replaced with the name of the group from which you want to remove the user.

For example, if you want to remove the user "john" from the group "developers", the command would look like this: "gpasswd -d john developers". This would remove "john" from the "developers" group.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the gpasswd tool