Relative and Absolute Paths

When changing directories, you can specify exactly where you want to go by specifying the correct path. As mentioned earlier in the lesson, a path is the shortest set of directories through which you must travel from the root directory to get to the current file or directory. Unix, however, has two different types of path statements that you absolutely need to be familiar with in order to completely understand how to navigate the system.

The two types of path statements in Unix are relative path statements and absolute path statements. Paths starting with the root directory and ending in a file or directory name are called absolute paths. In other words, absolute paths have absolutely everything contained within them, including the root statement /. One example of an absolute path statement is as follows:

> cd /usr/local/bin

On the other hand, a relative path is a shortened version of an absolute path. It contains only the directory in which you are currently working, and it does not include the root statement /. Consider the following example:

> cd bin

Remember, relative paths are relative to the current directory. Furthermore, absolute paths start with / and relative paths don't.

By this point, you know how to find out where you are, what files are in what directories, and how to move to different directories. In this lesson, we have covered not only several important commands, but some important theory as well. Now that we have dug deep into using the shell prompt to navigate the file system, let's take a moment to learn how to do it with a GUI, namely, KDE.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.224.64.248