3 pages html of absolute and relative for filesystem
git-svn-id: svn+ssh://atelier.inf.usi.ch/home/bevilj/group-1@56 a672b425-5310-4d7a-af5c-997e18724b81
This commit is contained in:
parent
6faa2d5ffe
commit
57e18e9289
3 changed files with 177 additions and 0 deletions
site/pages/fs/rela_abso
109
site/pages/fs/rela_abso/ab_re_fs.html
Normal file
109
site/pages/fs/rela_abso/ab_re_fs.html
Normal file
|
@ -0,0 +1,109 @@
|
|||
<html>
|
||||
<head>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<header>
|
||||
|
||||
|
||||
<div class = "title1">
|
||||
<h1>Absolute Path!</h1>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class = "title2">
|
||||
<h2>First, what is a path?</h2>
|
||||
</div>
|
||||
|
||||
|
||||
<div class= "text1">
|
||||
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 "/"
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class = "title3">
|
||||
<h3>Now, I can tell you what is an absolute path</h3>
|
||||
</div>
|
||||
|
||||
|
||||
<div class= "text2">
|
||||
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.
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class = "title4">
|
||||
<h4>To write an absolute path-name:</h4>
|
||||
</div>
|
||||
|
||||
|
||||
<div class= "text3">
|
||||
Start at the root directory ( / ) and work down.
|
||||
<br>Write a slash ( / ) after every directory name (last one is optional)
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class = "title5">
|
||||
<h5>Example:</h5>
|
||||
</div>
|
||||
|
||||
|
||||
<div class= "text4">
|
||||
<p> cat group1.txt </p>
|
||||
if for example, we use the above line, this commands work only and only if the "group1.txt" exist in the current directory.
|
||||
<br> If not works, it's not a problem, the file is present somewhere, before restart the new command, you have to know where
|
||||
<br> the file is saved.
|
||||
<br> Now, we supposed that you know where your file is saved you can rewrite the command.
|
||||
<p1> cat /home/a1/group1.txt </p1>
|
||||
Now, we suppose that the file is saved into folder a1 in home,
|
||||
<br>where: /home is the location respect to root, in fact, you have to descend one level
|
||||
<br>in the file system like above to access your file.
|
||||
|
||||
As you can see from the last commands, all the paths started from /directory whis is a root directory for every Unix machines.
|
||||
|
||||
|
||||
<p2> Other examples, where all are absolute path </p2>
|
||||
|
||||
|
||||
/home/user/Document/group1.txt
|
||||
/root/data/dev.jpg
|
||||
/var/log/messages
|
||||
</div>
|
||||
|
||||
|
||||
<div class = "title6">
|
||||
<h5>Example of Absolute path's uses:</h5>
|
||||
Now, as we learned from the previous pages we can use other commands in addition to "cat", such as:
|
||||
<br> chmod
|
||||
<br> ls
|
||||
<br> mv
|
||||
<br> get
|
||||
<br> text
|
||||
<br> rm
|
||||
and so on.. with the sintax like above.
|
||||
|
||||
|
||||
|
||||
/* esempi con altri comandi+foto */
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</header>
|
||||
</body>
|
||||
|
||||
</html>
|
35
site/pages/fs/rela_abso/ab_re_fs1.html
Normal file
35
site/pages/fs/rela_abso/ab_re_fs1.html
Normal file
|
@ -0,0 +1,35 @@
|
|||
<html>
|
||||
<head>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<header>
|
||||
|
||||
|
||||
<div class = "title1">
|
||||
<h1>Relative Path!</h1>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class= "text1">
|
||||
Relative path is defined as path related to the present working directory(pwd).
|
||||
<br>Suppose I am located in /home/user1 and I want to change directory to /home/user1/Documents.
|
||||
<br>I can use relative path concept to change directory to Documents.
|
||||
<br> <br> <br> <p> pwd/home/user1cd Documents </p>
|
||||
</div>
|
||||
|
||||
<br> <br> <br> Then you could tell me what is the difference between Absolute and Relative.
|
||||
|
||||
<br> If you observe, there is a little bit difference, where in relative there is no "/".
|
||||
<br> Meanwhyle using absolute path you have to write "/", in this case cd /home/user1/Documents.
|
||||
|
||||
/* esempi foto + comandi usati dietro */
|
||||
|
||||
|
||||
</header>
|
||||
</body>
|
||||
|
||||
</html>
|
33
site/pages/fs/rela_abso/ab_re_fs2.html
Normal file
33
site/pages/fs/rela_abso/ab_re_fs2.html
Normal file
|
@ -0,0 +1,33 @@
|
|||
<html>
|
||||
<head>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<header>
|
||||
|
||||
|
||||
<div class = "title1">
|
||||
<h1>ABSOLUTE VS RELATIVE</h1>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class= "text1">
|
||||
Now, you can ask, why I have to use one or another?
|
||||
<br> What is the difference? and questions like this.
|
||||
<br> <br> <br> Don't worry, the answer it's easy.., we can use an absolute path from any location
|
||||
<br> whereas you want to use relative path we should be present that you have to be in the working directory.
|
||||
</div>
|
||||
|
||||
|
||||
/*Pro and cons of both.. */
|
||||
|
||||
/* esempi foto + comandi usati dietro */
|
||||
|
||||
|
||||
</header>
|
||||
</body>
|
||||
|
||||
</html>
|
Loading…
Reference in a new issue