ユーザ starbuck を、ユーザID 3001 番、グループ blue で作成する例:
ホームディレクトリ /home/starbuck も同時に作成するために、 オプション(-m -d /home/starbuck)もつけます。
% sudo useradd -g bsg -u 3001 -m -d /home/starbuck starbuck
確認しましょう。
Q: ユーザ starbuck が作成されているか?
% tail /etc/passwd ... starbuck:x:3001:3000::/home/starbuck:/bin/sh
Q: /home/starbuck が作成されているか?
% ls -a /home/starbuck . .. .bash_logout .bashrc .profile
Copyright (C) 1993-2025 Ken'ichi Fukamachi mail:< fukachan at fml.org >