--- layout: page category-page: fs category-title: FileSystem tags: absolute relative path author: Marwan Announ title: paths ---
A path is a location to a folder or file in a file system of a Operating System, then is a combination of characters and "/"
An absolute path is defined as specifying the location of a file or directory from the root directory(/). In other words we can say absolute path is a complete path from start of actual filesystem from / directory.
Start at the root directory ( / ) and work down.
Write a slash ( / ) after every directory name (last one is optional)
if for example, we use the above line, this commands work only and only if the "group1.txt" exist in the current directory.cat group1.txt
cat /home/a1/group1.txt
Now, we suppose that the file is saved into folder a1 in home,Other examples, where all are absolute path
/home/user/Document/group1.txt /root/data/dev.jpg /var/log/messages
ls /etc
ls /usr/share/games if you have games obviously :)
cd /usr/share/games
cd ~
cat /etc/passwd
cp /etc/passwd /tmp
cd /tmp
cat passwd
So, if you dont't understand anything, like me before this writing, you have to know that Absolute pathnames start with a
slash on the left(simplyfied version..).
For example etc/passwd is a good example of Absolute pathnames.