how to set home directory for user in linux through command line code example Example: assign home directory to user linux usermod -d /path/to/dir username