Absolute Path vs Relative path in Linux | RHCSA on RHEL 8



0
71

In this video tutorial of Red Hat Enterprise Linux (RHCSA 8), I have explained and demonstrated about the Absolute and the relative paths of files and directories in Linux systems. So, let’s get started. First of all, I open the bash terminal. Adjusting the size, I put it on the left side and click on Activities and click on Files. In the graphical window, we can see the home directory of the user student and it’s sub directories. To go to the root directory, click on Other locations, on the left side of the window. Here, we can see the directory top directory which is /. If I double click on it, we can see the directories in the home directory. To check exactly the same thing by using the bash terminal, type ls –l /. The subdirectories of the top directories are listed. Running the command pwd, I can see the current directory path. Now, understanding the paths, here, /var/log/messages is the absolute path name for the system message log file. An absolute path is a fully qualified name, beginning at the root directory and specifying each subdirectory traversed to reach and uniquely represent a single file. Navigating to the absolute path from the current directory through messages in the graphical window, click on var, click on log and here we can see the file messages. But if I change the current directory to var, and then to log and here, listing the contents I can see the file. This is the relative path of the file. So to summarize, the full path name of a file from the home directory or any other directory is absolute path and the path name from inside the directory to the file is relative path. Okay, friends ! I hope you are clear about absolute path and relative path. That’s all for now, thanks for watching the video, see you in the next, until then have a nice time good bye !

Published by: Network Heros Published at: 2 years ago Category: علمی و تکنولوژی