Home >Operation and Maintenance >Linux Operation and Maintenance >How to return to the previous directory in Linux

How to return to the previous directory in Linux

醉折花枝作酒筹
醉折花枝作酒筹Original
2021-04-22 17:02:06105531browse

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".

How to return to the previous directory in Linux

#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.

How to return to the previous directory in Linux

Method 1:

For example, click on the terminal. Then enter [pwd] to display the current path.

How to return to the previous directory in Linux

How to return to the previous directory in Linux

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.

How to return to the previous directory in Linux

#[pwd] again, then you can see the return to the home directory.

How to return to the previous directory in Linux

Method 2:

Or simply, enter: cd and the upper-level directory instead of [..].

How to return to the previous directory in Linux

How to return to the previous directory in Linux

Then press the Enter key to return to the previous level.

How to return to the previous directory in Linux

(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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn