How to Change the Home Directory of a User in Linux



Linux


In this article, we show how to change to the home directory of a user in linux.

The home directory of a user that is directory that is labeled 'home'. It normally has the path, users/david/home

If you are in a linux shell, you can get to the home directory of the current user who is logged in by the ~ symbol.

This is shown below.



This will change directory to the home directory of the current user logged in .

If you want to change to the home directory of another user, let's say anthony, then you specify the ~ symbol followed by the name of the user.

In the following code below, we change the current working directory to the home directory of the user anthony.



This now changes the home directory to the home directory of the user anthony.

So this is how we can change the current directory to the home directory of a user in linux.


Related Resources

How to Randomly Select From or Shuffle a List in Python



HTML Comment Box is loading comments...