• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

groupadd: command not found

by admin

The groupadd command creates a group. By default, the group has no members and no password. In addition to creating a group with a friendly name, you can also specify a group ID using the -g option.

Some groupadd options include the following.

Option Description
-g Assign a group ID.
-f Exit with a success status if the group already exists.
-o Allow a group to be created with a non-unique group ID.

The groupadd command allows you to add groups to the system from the command line. To do so, log in as the root user and enter the following command:

# groupadd groupname

where groupname is the name of the group you want to add to the system. For example, to add the group www to your system, you would use the command:

# groupadd www

If you encounter below error while running the groupadd command:

groupadd: command not found

you may try installing the passwd package as shown below as per your choice of distribution.

Distribution Command
Debian apt-get install passwd
Ubuntu apt-get install passwd
Alpine apk add shadow
Arch Linux pacman -S shadow
Kali Linux apt-get install passwd
Fedora dnf install shadow-utils-2
Raspbian apt-get install passwd

groupadd Command Examples

1. To create a new group:

# groupadd SUPPORT 

2. To show success status if the group already exists:

# groupadd -f SUPPORT
# groupadd --force SUPPORT

3. To specify the numerical group ID:

# groupadd -g 504 SUPPORT
# groupadd --gid 504 SUPPORT

4. To get the help info:

# groupadd -h
# groupadd --help

5. To specify the “/etc/login.defs” values:

# groupadd -K KEY=VALUE
# groupadd --key KEY=VALUE
# groupadd -K GID_MIN=100
# groupadd -K GID_MAX=499

6. To add a group with non-unique vale:

# groupadd -o 500 SUPPORT
# groupadd --non-unique 500 SUPPORT 

7. To specify the encrypted password for group:

# groupadd --password !$424733244%^12124 SUPPORT 

8. To create a system group:

# groupadd -r 499 SUPPORT 

Conclusion

The groupadd command can be used with multiple options to create a supplementary group for user accounts, or a system user group. See the man page regarding groupadd for a full list of all the command-line options available.

Filed Under: Linux

Some more articles you might also be interested in …

  1. How to use ipset Command in Linux
  2. namcap: command not found
  3. CentOS / RHEL 6,7 : How to disable or delete virbr0 interface
  4. watch Command Examples in Linux
  5. feedreader Command Examples in Linux
  6. http_load Command Examples in Linux
  7. How To Identify User Deleting Files From A Given Directory in Linux
  8. foreman: command not found
  9. tuned-adm and Oracle
  10. Common Error Messages from Command xfs_repair in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • protonvpn-cli Command Examples in Linux
  • protonvpn-cli connect Command Examples
  • procs Command Examples in Linux
  • prlimit: command not found

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright