Search results
Results from the WOW.Com Content Network
In this tutorial, you will see several different ways to return to the user’s home directory with the cd command in Linux. We’ll also throw in another bonus tip to make your life using the command line a little easier.
The easiest way to find a user’s home directory in Linux is by using the ~ symbol. This is a shortcut that stands for the home directory of the current user. Type in the following command: ls ~. This will list all of the files and directories in your home directory.
We can change the home directory for an existing user in Linux by using usermod command. To do this, simply run the following command: usermod -d /new/home/directory username
On Linux the tilde symbol (~) is used as a shortcut for your current user’s home directory. This means that if we use the cd command followed by the tilde symbol on our Linux system, we will be taken to our home directory.
The cd (“change directory”) command is used to change the current working directory in Linux and other Unix-like operating systems. It is one of the most basic and frequently used commands when working on the Linux terminal.
Use your file manager‘s graphical interface to navigate to /home/. Being able to instantly jump into your home folder from anywhere is extremely handy. The cd, cd ~, and cd $HOME commands are good to memorize. Let‘s look at what your home directory contains by default.
The easiest way is to simply type cd. Argumentless cd means cd will bring you to your home directory, which is also known as ~. This means cd ~ would also work, albeit with a couple more keystrokes.