theshell.ch/site/pages/fs/absolute.html
bevilj 67a86268c1 proj: code review 1.1
git-svn-id: svn+ssh://atelier.inf.usi.ch/home/bevilj/group-1@130 a672b425-5310-4d7a-af5c-997e18724b81
2018-11-12 10:47:50 +00:00

37 lines
1.3 KiB
HTML

---
layout: page
category-page: fs
category-title: FileSystem
tags: absolute relative path
author: Marwan Announ
title: Absolute paths
---
<p>
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 "/".<br>
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.<br><br>
<h3>To write an absolute path-name:</h3>
Start at the root directory ( / ) and work down.<br>
Write a slash ( / ) after every directory name (last one is optional).<br>
If for example, we the commands "cat group1.txt", it'll work only and only if the "group1.txt"
exist in the current directory.<br>
If doesn't works, it's not a problem, you just have to know where the file is actually stored.<br>
Now, we suppose that you know where your file is saved so you can rewrite the command.
"cat /home/a1/group1.txt".<br>
As you can see from the last commands, the path started from "/" which is the root directory
for every Unix machines.<br>
Here are some other examples of absolute paths:
<ul>
<li>/home/user/Document/group1.txt</li>
<li>/root/data/dev.zip</li>
<li>/var/log/messages</li>
</ul>