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