助け合いフォーラム
LinuC Lv1-102(Ver10.0)
問題ID : 15493
問題を開く
ユーザ「testuser」のホームディレクトリを「/home/hogehoge」に変更したい。適切なコマンドは次のうちどれか。
この問題はプレミアムコンテンツです。
linuc 102について
投稿日 2025/12/21
usermod -d usermod -m の違いはなんですか
2025/12/21 23:09
検索したら簡単にヒットしますが…例えば https://linux.die.net/man/8/usermod から引用すると
-d, --home HOME_DIR
The user's new login directory.
If the -m option is given, the contents of the current home directory will be moved to the new home directory, which is created if it does not already exist.
-m, --move-home
Move the content of the user's home directory to the new location.
This option is only valid in combination with the -d (or --home) option.
と、 -d と同時に -m が指定されているとユーザーのホームディレクトリのコンテンツを指定されたディレクトリに移動させる、というオプションだと書いてありますね。
コメント
この投稿に対して返信しませんか?