How to move home directory contents?

QuestionsQuestions8 SkillsProUser Account ManagementNov, 24 2025
075

To move the contents of a home directory to a new location, you can use the mv command in the terminal. Here’s how you can do it:

  1. Open your terminal.

  2. Use the mv command to move the contents. For example, if you want to move all contents from /home/olduser to /home/newuser, you can use the following command:

mv /home/olduser/* /home/newuser/

This command moves all files and directories from olduser's home directory to newuser's home directory.

Notes:

  • The * wildcard is used to select all files and directories.
  • Make sure you have the necessary permissions to move the files.
  • If you want to include hidden files (those starting with a dot), you can use:
mv /home/olduser/{*,.*} /home/newuser/

This will move both visible and hidden files.

0 Comments

no data
Be the first to share your comment!