On Linux and other Unix-like operating systems, the cd command can change the current working directory. Working in the current directory of a computer is also referred to as the user’s current directory. In this article, we will dive deeper into the cd command and give you a brief on cd up one level Linux.
cd Up One Level Linux
You are always in a home directory when you open the terminal. To change the directory and move to another directory cd command is used in the following ways.
Root directory navigation: Type “cd/” to enter the root directory.
Home directory navigation: we use the “cd~” or “cd” command to move into the home directory.
Up to one level: moving up one level in the directory, we use the “cd..” command in the following way:
Back one level: we use the “cd-” command to return back to the previous folder.
Multiple level navigation: we can use a complete path to go to the specific directory along with the cd command in the following way:
Remember, there is space between cd and the specified path.
Directory name having spaces: if your directory name contains the spaces in the name, then the name should be written inside the quotes in the following way: e.g., “My home route” is my directory name the I will write as:
Conclusion
In this article, we have discussed the current working directory and cd command. Also, we have seen how to use the cd command in multiple navigations. We hope you enjoyed the article. Please visit our website to read more articles.