first two pages of hard links

git-svn-id: svn+ssh://atelier.inf.usi.ch/home/bevilj/group-1@137 a672b425-5310-4d7a-af5c-997e18724b81
This commit is contained in:
vivanr 2018-11-12 12:31:50 +00:00
parent 99c1731ed2
commit ccf4d69c4a
2 changed files with 66 additions and 0 deletions

View File

@ -0,0 +1,50 @@
---
layout: page
category: Filesystem
tags: Hard links
author: Ricardo Vivanco
title: fs
previous-page: pages/fs/Hard
---
<html>
<head>
</head>
<body>
<header>
<h1>Hard and Symbolic links</h1>
<p>In Unix-like operating systems such as Linux, “everything is a file” and a file
is fundamentally a link to an inode (a data structure that stores everything about a
file apart from its name and actual content).
A hard link is a file that points to the same underlying inode, as another file.
In case you delete one file, it removes one link to the underlying inode. Whereas a
symbolic link (also known as soft link) is a link to another filename in the filesystem.
Another important difference between the two types of links is that hard links can only
work within the same filesystem while symbolic links can go across different filesystems.
</p>
</header>
</body>
</html>

View File

@ -0,0 +1,16 @@
<h1>How to Create Hard Links in Linux</h1>
<p>To create a hard links in Linux, we will use ln utility. For example, if you want
to create a hard link named "hard_link1" to the file "file1" you can use first
the <code> ls <code> <code> -l <code> command in order to see all files. Then you
write <code> ln <code> "file1" "hard_link1" and after that if you write down again
<code> ls <code> <code> -l <code> you can finally see the hard link named "hard_link1"
created. Looking at that output, using <code> ls <code> command, the new file is not indicated
as a link, it is shown as a regular file. This implies that "hard_link1" is just another
regular executable file that points to the same underlying inode as "file1".
If you desire to make a hard link directly into a soft link, use the <code> -P <code> flag
like this: <code> ln <code> <code> -P <code> "file1" "hard_link1"
</p>