Questions tagged [hard-link]
A hard link is file system entry that associates a name with another file on a file system.
262 questions
0 votes
1 answer
62 views
rsync with --include-from breaks hardlinks (evec with -H)
I'm trying to copy a bunch of files (around 50000) from an include-file list. THe include-file has relative path to the files on the source folder. I'm using the following command : rsync -avPilHAXWE \...
0 votes
3 answers
164 views
Why can't I use `rm -r` on a symlink pointing to a directory?
I understand that in unix systems symlinks can link to files and directories and are files themselves so if I want to remove a symlink I need to rm symlink without the trailing /. But they otherwise ...
0 votes
2 answers
143 views
How to programmatically deduplicate files into hard links while maintaining the time stamps of the containing directories?
Continuing https://unix.stackexchange.com/a/22822, how to deduplicate files, given as a list, into hardlinks, while maintaining the timestamps of their directories? Unfortunately, hardlinks changes ...
1 vote
0 answers
121 views
How to get `rsync --link-dest=` hard-link moved/renamed files
I am trying to set up rsnapshot for backing up a remote server. However, I realize that my issue is with rsync (rsnapshot’s back-end), not with rsnapshot itself. Thus I am focusing the question on ...
11 votes
6 answers
3k views
Why are symbolic links more common than hard links in Unix/Linux? [closed]
I frequently find myself googling the difference between symbolic links and hard links. Each time, I conclude that hard links seem superior in most use cases, especially when Linux is my daily driver. ...
6 votes
1 answer
1k views
Is a filesystem without hard links practical as /home on Linux?
I have a novel filesystem in mind, but the structure makes it impossible to implement more than one hard link to each inode. ("." and ".." are handled differently.) It is not ...
0 votes
1 answer
119 views
How to Avoid Copying Large Folders When Creating a chroot Sandbox Using Symlinks, Hard Links, or Bind Mount?
I am working on creating a chroot sandbox and want to avoid the time-consuming and storage-intensive process of copying large directories such as bin, lib, and others. Is it possible to use symbolic ...
0 votes
0 answers
33 views
ls long listing column "number of hard links": What does that mean? [duplicate]
Please shed some light on that erratic, second column of ls -l, that numeric column between the 1st one - the permission string - and the third one - the user ownership. I just can't pin it down, what ...
3 votes
3 answers
429 views
Why hard link doesn't corrupt if we remove the original file? [duplicate]
Why the hard link doesn't corrupt if we remove the original file? If I remove the original file then the softlink gets corrupt but hard link doesn't so why it does't corrupt
1 vote
1 answer
209 views
mirror a directory tree by hard links for file contents and symlinks for directory structure
what is the best way to mirror an entire directory, say original/, to a new directory, say mirror/, which has the structure mirror/data/ and mirror/tree/, such that every file in the directory ...
0 votes
2 answers
132 views
Creating hard links [duplicate]
$ ln fun fun-hard $ ln fun dir1/fun-hard $ ln fun dir2/fun-hard $ ls -1 total 16 drwxrwxr-x 2 me 4096 2018-01-14 16:17 dir1 drwxrwxr-x 2 me 4096 2018-01-14 16:17 dir2 -rw-r—-r—- 4 me 1650 2018-01-10 ...
3 votes
1 answer
184 views
Hard link as destination of cp and rsync
Where do I find documentation of behavior of cp and rsync commands when the destination path shares the inode with another path? In other words, when I do $ cp [options] src dest $ rsync [options] src ...
0 votes
2 answers
96 views
Creating a hard link increases the hard link count for two names
gui@Latitude:~$ cd playground gui@Latitude:~/playground$ ls -l total 8 drwxrwxr-x 2 gut gut 4096 set 20 16:18 dir1 -rw-r--r-- 1 gut gut 2903 set 20 14:46 gato gui@Latitude:~/playground $ ln gato gato-...
-1 votes
1 answer
105 views
creating hard links Linux question [duplicate]
From the book The Linux Command Line by William Shotts, page 33: So now we have four instances of the file fun. Let's take a look at our playground directory. [me@linuxbox playground]$ ls -1 total 16 ...
0 votes
0 answers
158 views
How do I get the number of hardlinks of a folder?
I am on Mac. However, I use gstat (GNU stat) so my understanding is that behavior should match linux. I cd to a folder. Then I use gstat --format=%h .. The output is 65. Next, I use gfind . -maxdepth ...