Skip to content
  • About
  • Courses
  • ResearchExpand
    • Research Publications
    • Books
    • Patents
    • Ph.D. Supervised
  • Workshop/Conferences
  • ToolsExpand
    • Creative Image Converter
    • Creative QRCode Generator
    • Creative QR Code Generator Tool
    • EMI Calculator
    • SIP Calculator
  • Blog
  • Resume
One Page CV

Removing Users

Commands for Removing Users and Groups in Unix-like Systems

CommandPurposeKey OptionsExample
userdelRemove a user account from the system-r (remove home directory)Example:
1. Delete user john and remove home directory: sudo userdel -r john
deluserRemove a user account (alternative to userdel)NoneExample:
1. Delete user john: sudo deluser john
gpasswdRemove a user from a group-d user group (remove user from group)Example:
1. Remove user john from the developers group: sudo gpasswd -d john developers
delgroupDelete a group from the system--system (delete system group)Example:
1. Delete the testgroup group: sudo delgroup testgroup

Example Usage:

  1. Remove a User with userdel:
    • Delete user john and remove their home directory:bashCopy codesudo userdel -r john This command deletes the user john and removes their home directory.
  2. Remove a User with deluser:
    • Delete user john:bashCopy codesudo deluser john This command deletes the user john from the system. It does not remove the user’s home directory or files by default.
  3. Remove a User from a Group with gpasswd:
    • Remove user john from the developers group:bashCopy codesudo gpasswd -d john developers This command removes the user john from the developers group.
  4. Delete a Group with delgroup:
    • Delete the testgroup group:bashCopy codesudo delgroup testgroup This command deletes the testgroup group from the system. Note that delgroup is typically used for removing non-system groups.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Nishant Munjal

Coding Humanity’s Future </>


Facebook Twitter Linkedin YouTube Github Email

Tools

  • SIP Calculator
  • EMI Calculator
  • Creative QR Code
  • Image Converter

Resources

  • Blog
  • Contact
  • Refund and Returns

Legal

  • Disclaimer
  • Privacy Policy
  • Terms and Conditions

© 2025 - All Rights Reserved

  • About
  • Courses
  • Research
    • Research Publications
    • Books
    • Patents
    • Ph.D. Supervised
  • Workshop/Conferences
  • Tools
    • Creative Image Converter
    • Creative QRCode Generator
    • Creative QR Code Generator Tool
    • EMI Calculator
    • SIP Calculator
  • Blog
  • Resume
Download CV
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.