Linux pathname Relative Vs. Absolute
Linux directories are helpful to store files. Many a time, the programmer would trade in directory paths. The paths are two types - absolute and relative. I have shared simple ideas to remember the differences between these two.
![]() |
Linux |
Absolute Vs. Relative
Below are the differences between these two.
Absolute pathname
An example is /usr/lib, which is an exact directory in the directory tree.
Think of the absolute pathname as being the complete mailing address for a package that the postal service will deliver to your next-door neighbor.
Keep Reading
Relative directory name
An example is cups, which represents the cups subdirectory of the current directory, whatever that may be.
Think of the relative directory name as giving the postal carrier directions from your house to the one next door so that the carrier can deliver the package.
How to go back to the home directory
If I type cd cups in /usr/lib, the current directory changes to /usr/lib/cups. If type the same command in /home/edulaney, the shell tries to change the current directory to /home/edulaney/cups.
Comments
Post a Comment
Thanks for your message. We will get back you.