Questions tagged [hard-link]
49 questions
218
votes
6 answers
Why are hard links not allowed for directories?
I am using Ubuntu 12.04. When I try to create a hard link for any directory, it fails. I can create hard links for files inside file system boundary. I know the reason why we cannot create hardlinks for files beyond file system.
I tried these…
Nischay
- 3,771
52
votes
5 answers
Are hard links equivalent to Windows shortcuts?
Wikipedia defines a hard link as:
a directory entry that associates a name with a file on a file system. (A directory is itself a special kind of file that contains a list of such entries.) The term is used in file systems which allow multiple…
Computernerd
- 1,401
16
votes
4 answers
How to find all hardlinks in a folder?
I have two external disks that has the same files. One is encrypted, the other is not. The encrypted one has a lot less space left than the non encrypted, I now assume that it is because of hardlinks on the non encrypted disks.
So I would like to…
Jeno
- 375
- 3
- 14
- 28
16
votes
1 answer
Why is there a .steampath in my home directory?
In the terminal, I see a broken link which is named .steampath, I didn't remove /home/user/.steam/sdk32/steam, but it is gone.
Why is the .steampath there?
Should I remove it?
JulianLai
- 1,592
9
votes
2 answers
What are some typical uses of hard links?
Everyone who was used to Windows can imagine what symlinks are and how they're used. On the other hand, the hard link concept is foreign to Windows (am I correct?).
I would like to know what are the typical uses to hard links in Linux. I've already…
To Do
- 15,833
7
votes
2 answers
Colorize hardlinks in ls output?
How can I colorize hardlinks myself? Turns out on an old Ubuntu 10.04 I have, this happens by default (same .bashrc and .profile in use), whereas on the newer Ubuntu 12.04 it doesn't.
This is the output on Ubuntu 10.04 (the one I desire):
And this…
0xC0000022L
- 5,870
6
votes
2 answers
Nautilus - no support for hard links?
I finally got round to studying and understanding hard links in my quest to check I have understood the basics, of which I have managed to skip a lot of. After realizing how brilliant they are, I wonder why there isn't better support for them in…
Programster
- 6,039
6
votes
2 answers
Does dropbox sync hardlinks?
I have a folder of large files. I want that folder to be in two different places at once - my Home documents, and my College documents folder.
I've done this with a symlink in the College folder to the Home folder.
Unfortunately, Dropbox syncs my…
Tim
- 33,500
5
votes
1 answer
Is "mount --bind dir1 dir2" an alternative for hard links for directories?
It's a known fact that you cannot create hard links for directories.
My question is whether can one use mount --bind dir1 dir2
instead of creating a hardlink of dir1 to dir2? which can't happen
4
votes
1 answer
When would you want to use a Hard link instead of a soft link? An example to help Understand the difference
I have read lots of posts on What is the difference between soft and hard link but still am a bit vague on the difference. I wonder could somebody give just one or two example(s) of when you would want to use a Hard link instead of a soft? Just a…
FreeSoftwareServers
- 1,129
- 1
- 14
- 32
4
votes
2 answers
Script Remove All hardlinks for a specific file
I want to delete all hardlinks for a specific file.
The usage would be script somefile, this would count the hardlinks for the file somefile, then it's going to delete all hardlinks keeping this file only.
The command
find / -samefile file-name |…
Maythux
- 87,123
3
votes
2 answers
List all files with multiple hardlinks and related path
How can I list all files with hardlinks and the associated paths?
It should be a sorted list, by the inode ID.
EDIT:
sure, I mean all files with a hardlink number >=2
I thought about a list like
INODE_ID FILEPATH
1234 /tmp/test1
1234…
2IRN
- 745
3
votes
1 answer
Default number of links for directory?
I know that hard link can not point to directories but when i create an empty directory and execute stat command for it
links=2 ,I search for symbolic links
There is not another link. why for directory the default numbers of links=2?
Sinoosh
- 2,101
3
votes
2 answers
What happens when you make a hard link to a file in /mnt, and then unmount?
As far as I know, hard links will not break when a file is deleted. Because the file will remain to exist.
But what happens when you mount a file system to /mnt for example, create a hard link to a file on that volume, unmount the volume, and then…
foxite
- 451
3
votes
1 answer
why does directory contain 2 hard links
When I create a new directory it contain 2 hard links and when I go inside to the new directory it contain two directories (. and ..) . has hard link count 2 and .. has hard link count 3, but I learn that directory can not contain more than one hard…
Roledenez
- 1,205