Home >Operation and Maintenance >Linux Operation and Maintenance >How to return to the previous directory in Linux
Linux method to return to the upper-level directory: 1. Enter the "cd /upper-level directory name" command in the terminal and press the "Enter key"; 2. Enter cd and the upper-level directory in the terminal Instead of "..", the command format is "cd ..", just press the "Enter key".
#The operating environment of this tutorial: centos7 system, thinkpad t480 computer.
Linux generally uses commands to operate. If you want to return to the previous directory, how should you do it? Let’s take a look at the detailed tutorial below.
Method 1:
For example, click on the terminal. Then enter [pwd] to display the current path.
Then the upper-level directory is home under the root, then return to the upper-level directory and enter [cd /home] without missing the slash.
#[pwd] again, then you can see the return to the home directory.
Method 2:
Or simply, enter: cd and the upper-level directory instead of [..].
Then press the Enter key to return to the previous level.
(Recommended learning: linux tutorial)
The above is the detailed content of How to return to the previous directory in Linux. For more information, please follow other related articles on the PHP Chinese website!