theshell.ch/site/pages/fs/Hard_links.html
vivanr 6fd7c7c0bb revision1 of first two pages for hard links
git-svn-id: svn+ssh://atelier.inf.usi.ch/home/bevilj/group-1@138 a672b425-5310-4d7a-af5c-997e18724b81
2018-11-12 12:39:46 +00:00

39 lines
1.1 KiB
HTML

---
layout: page
category: Filesystem
tags: Hard links
author: Ricardo Vivanco
title: fs
previous-page: pages/fs/Hard:symbolic_links.html
---
<html>
<head>
</head>
<body>
<header>
<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>
</header>
</body>
</html>