What is the `-m` flag?

QuestionsQuestions8 SkillsProUser Account ManagementAug, 24 2025
0138

The -m flag in the usermod command is used to move the contents of the user's current home directory to the new home directory specified with the -d flag. When you use both -d and -m, it ensures that the files and directories in the old home directory are transferred to the new location.

For example:

sudo usermod -d /new/home/directory -m username

This command changes the home directory of the user username to /new/home/directory and moves all the contents from the old home directory to the new one.

0 Comments

no data
Be the first to share your comment!