deluserコマンド(Debian系のみ?)
システムを利用するユーザを削除する。管理者権限が必要なため、sudo を付けるか root ユーザで実行する。
書式: $ sudo deluser ユーザ名
書式: $ sudo deluser オプション ユーザ名
$ sudo deluser --remove-all-files test
Looking for files to backup/remove ...
Removing files ...
Removing crontab ...
Removing user `test' ...
Done.
| オプション | 内容 |
|---|---|
| --remove-home | ユーザのホームディレクトリとメールスプールも削除する 入力例: sudo deluser --remove-home ユーザ名 |
| --remove-all-files | ユーザが所有するすべてのファイルを削除する 入力例: sudo deluser --remove-all-files ユーザ名 |
| --backup | ユーザのデータを削除する前にアーカイブを作成する(--remove-home または
--remove-all-files と併用) 入力例: sudo deluser --remove-home --backup ユーザ名 |
| --group | 指定したグループを削除する(ユーザではなくグループ用) 入力例: deluser --group グループ名 |
deluserはDebian系(Ubuntu, Debianなど)に標準で搭載されているが、Red Hat系(RHEL, CentOS,
Fedoraなど)ではuserdelコマンドを使う。
rootまたは管理者権限が必要なため、通常はsudoと併用する。