Linux command
deluser 命令
安全
May affect permissions or system state. Check the target first.
命令示例
Remove
sudo deluser [username]
Example
sudo deluser --remove-home [username]
Example
sudo deluser --backup-to [path/to/backup_directory] --remove-home [username]
Example
sudo deluser --remove-all-files [username]
Example
sudo deluser [username] [group]
说明
deluser removes users from the system. It can optionally remove the user's home directory, mail spool, and other files. It's the Debian/Ubuntu counterpart to userdel. When given both a user and group name, it removes the user from that group without deleting the user account.
参数
- --remove-home
- Remove user's home directory
- --remove-all-files
- Remove all files owned by user
- --backup
- Backup files before removal
- --backup-to _dir_
- Backup destination directory
- --system
- Only delete if system user
FAQ
What is the deluser command used for?
deluser removes users from the system. It can optionally remove the user's home directory, mail spool, and other files. It's the Debian/Ubuntu counterpart to userdel. When given both a user and group name, it removes the user from that group without deleting the user account.
How do I run a basic deluser example?
Run `sudo deluser [username]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does --remove-home do in deluser?
Remove user's home directory