The basics of how to use Linux (如何使用Linux,基础笔记四)

Navigation in Linux

Before we said “Everything is the file in Linux” and know some important directories, and those files are under various directories. In this blog, we are going to see some commands which help us navigate in directories of Linux.

1. Understanding The File System Tree

Cite from Linux command lineCite from Linux command line

2. Display the current working directory, which show where we are at : “pwd”

e.g. 在这里插入图片描述

3. Change the current working directory : “cd”

The command, “cd”, can help us to navigate through Linux directories.
e.g.在这里插入图片描述
3.1. Absolute pathname and Relative pathname
For the usage of “cd”, we have to introduce two concepts, “absolute pathname” and relative pathname.

Absolute pathname means the file’s name which a name contains paths from the root to the current directory and pulses the name of file.
e.g.
在这里插入图片描述
Relative pathname involves the relationship between tow files, and it describes a location of one file which is relative to another file.

e.g.
在这里插入图片描述
In the exampe above, the relative pathname(“linuxPractices/dir1”) involves tow files, the current directory(“local”) and the directory (dir1) which is under the “local/linuxPractices”, and we omit the current path.

3.2. Some tips

3.2.1. The “.” stands for the current directory
e.g.
在这里插入图片描述
3.2.2. The “…” stands for the super (top) directory which contains the current directory.
e.g.
在这里插入图片描述
在这里插入图片描述
3.2.3. Some useful shortcuts
Cite from Linux command line

发布了20 篇原创文章 · 获赞 3 · 访问量 263

猜你喜欢

转载自blog.csdn.net/qq_34515959/article/details/96713285
今日推荐