• 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

deluser Command Examples in Linux

by Deepika

deluser is a command line tool in Linux that can be used to delete a user account and its related files and directories. It is typically used by system administrators to remove user accounts that are no longer needed.

deluser Command Examples

1. Remove a user:

# deluser username

2. Remove a user and their home directory:

# deluser --remove-home username

3. Remove a user and their home, but backup their files into a `.tar.gz` file in the specified directory:

# deluser --backup-to path/to/backup_directory --remove-home username

4. Remove a user, and all files owned by them:

# deluser --remove-all-files username

5. To delete a user account and its related files and directories:

# deluser --backup --remove-all-files username

6. To delete a user account and its related files and directories and also delete the user’s mail spool:

# deluser --backup --remove-all-files --remove-mail-spool username

Please note that deluser is a command that is used to delete a user account from the system, it’s important to be careful when using this command as it can cause data loss if used improperly. It’s always a good idea to backup the data before removing a user account.

Filed Under: Linux

Some more articles you might also be interested in …

  1. light: command not found
  2. CentOS / RHEL : How to disable ssh for non-root users (allowing ssh only for root user)
  3. gnome-screenshot: command not found
  4. How to use ipset Command in Linux
  5. How to install and configure sosreport under CentOS / RHEL
  6. aplay: command not found
  7. SSSD Service Failing with “SSSD is already running” in CentOS/RHEL 7
  8. traceroute Command Examples in Linux
  9. How to fix the “Firefox already running” problem on Linux
  10. CentOS / RHEL 7 : How to configure Network Bonding or NIC teaming

You May Also Like

Primary Sidebar

Recent Posts

  • powertop Command Examples in Linux
  • powertop: command not found
  • powerstat: command not found
  • powerstat Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright