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

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • 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. gh label: Work with GitHub labels on the command-line
  2. darkhttpd: Darkhttpd web server
  3. “git ls-tree” Command Examples
  4. asterisk Command Example
  5. uuid Command Examples in Linux
  6. How to uninstall aria2 from Ubuntu
  7. light: command not found
  8. colorpicker: A minimalist X11 colorpicker
  9. dvc destroy: Remove all DVC files and directories from a DVC project
  10. mountpoint: command not found

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright