Questions tagged [hard-link]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2 votes
2 answers
2k views

home/user/Desktop and Public Folders Show as Type Link (broken) (inode/symlink)

Ubuntu 22.04 LTS asked me for an update which I did and apparently everything went ok but upon restarting all my home folders appeared in my Desktop. Looking into my home folder I found out that home/...
Ventolinmono's user avatar
1 vote
0 answers
3k views

"Invalid cross-device link" hard for directories on the same filesystem

I know hard links can't cross filesystems, but trying to link files via bind mounts that physically live on the same filesystem fails as well. I detailed things below to visualize it better, but the ...
Bill's user avatar
  • 11
0 votes
1 answer
82 views

What kind of directories are these?

I'm looking at a directory that was created for backups. One of the subfolders is the root of a Git repo, and contains the .git folder. That folder also contains links to other folders in the system. ...
TonyG's user avatar
  • 187
0 votes
0 answers
952 views

Unable to create hard links on Samba Share

I am trying to create backup snapshots to my Samba shared drive. The idea is rather than overwriting the backup every time, I would like to create incrementing backup with hard links using rsync as ...
Batwam's user avatar
  • 133
1 vote
1 answer
317 views

is changing symlinks for "linux from scratch" harmful?

I started linux from scratch for educational purpose. In preparing section it says: Bash-3.2 (/bin/sh should be a symbolic or hard link to bash) Bison-2.7 (/usr/bin/yacc should be a link to bison or ...
hepl's user avatar
  • 27
0 votes
2 answers
415 views

Safely remove directory with unknown contents

I have a directory /usr/local/foo, which I need to remove. This is going to be part of a script, which needs to be run as root. I'm mainly worried that the directory, which contains things that users ...
Michael's user avatar
  • 65
0 votes
0 answers
96 views

how can I give FTP files link for make them downloadable easily through that link?

I am new here and a beginner at Linux Ubuntu. First of all, I created an FTP server and configured it. I give access only to some users that I choose. When I try to download files through get command,...
malak's user avatar
  • 1
0 votes
1 answer
548 views

Stop `cp -al` trying to link to hidden files?

I would like to make a "hard-links" copy of my home directory before syncing my home directory with another computer with unison, just in case unison goes awry. But cp -al tries to link to ...
B.Tanner's user avatar
  • 2,636
0 votes
0 answers
2k views

Symbolic link not working

I tried to make a symbolic link between directories, but it's not working. I made a directory called C_drive and then did the following command: sudo ln -s this/directory/way/over/here/myfolder ~/...
JohnB42's user avatar
  • 191
0 votes
1 answer
230 views

Can a hard link refer to a file in a different filesystem?

Can a hard link refer to a file in a different filesystem? Why or why not?
Garry Jean Pierre's user avatar
0 votes
1 answer
348 views

Is metadata (dates) for hardlinked files shared or unique? Inodes and linked files!

I always assumed that the dates in each inode were maintained separately even with hardlinks. However if I change (touch/slap) the date of a hardlink file all other hardlinks to the same file show ...
WallyZ's user avatar
  • 212
3 votes
0 answers
38 views

16.04: File with no hardlink

I have a directory with these files on an Ubuntu 16.04 server: -rwxrwxrwx 1 nobody nogroup 162034 Apr 1 2019 accounts.log -rwxrwxrwx 1 nobody nogroup 2336191 Apr 17 2019 app.access.log -...
Lucas B's user avatar
  • 131
2 votes
2 answers
1k views

Delete hard link between two files

I made a hard linked file in terminal by command: ln somefile somefile_h and used it for fun. Now I faced a question that how can I delete the link between these two files and use it separately? ...
Aprime's user avatar
  • 141
1 vote
0 answers
70 views

Cannot double-click/open docx files and file-shortcuts at desktop at Ubuntu19.4

I recently upgraded to ubuntu 19.4. I used to ctrl+shift drag and drop files at desktop, in order to create shortcuts. At 19.4 some very useful functionalities are removed, I hope for good reason. You ...
Thanasis Mattas's user avatar
1 vote
1 answer
405 views

Am I using the "ln" and "unlink" commands correctly?

I have several JavaScript projects that use the same set of utility scripts. Today after copying (cp) the library folder for the dozenth time, I did some research I found the ln && unlink ...
Malekai's user avatar
  • 131
2 votes
0 answers
443 views

cp -l instead of cp -s does not work?

I have a folder symlink to core files and a folder with my improvements like this: core/ -> /some/distant/root/directory/core/ script_a.py special/script_b.py special/script_c.py core-improvements/ ...
aleskva's user avatar
  • 1,647
15 votes
1 answer
7k views

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's user avatar
  • 1,572
0 votes
0 answers
171 views

Why are the by-hash directories on ubuntu mirrors not hard linked?

I noticed that the files in the by-hash directories are not hardlinked to the actual files, as I would have expected. This means that any mirror downloads consume double the time and bandwidth for the ...
chutz's user avatar
  • 183
2 votes
0 answers
190 views

Back-in-time disk usage

I am using Back-in-time with encryption on a remote server (ext4 FS). I am aware that for an unencrypted backup, BiT uses hard links. Thus in nautilus, the folder size appears to be huge. The actual ...
user5325's user avatar
  • 408
15 votes
4 answers
21k views

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 ...
Jeno's user avatar
  • 305
1 vote
0 answers
77 views

directory link count equals 1

after reading that every directory has at least 2 links (from its parent and from itself), I encountered directories with link count == 1 root@ubuntu:~# ll /var/lib/mysql total 28676 drwx------ 1 ...
Omriko's user avatar
  • 111
0 votes
1 answer
100 views

Symlink breaks after usage

I have OpenERP 7 and I am trying to get the attachments to be saved on the local file system Configurations on OpenERP are done and are working, but it would only save the files to the installation ...
Faez abdulkarem's user avatar
5 votes
2 answers
2k views

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 ...
Programster's user avatar
  • 5,871
3 votes
2 answers
4k views

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 ...
2IRN's user avatar
  • 725
2 votes
2 answers
164 views

using link command to see how it works

link file1.txt file2.txt file1.txt contains ham and file2.txt contains cheese. I added 123 in file1.txt. Now file1.txt has ham123. If my understanding is correct, any changes made in either file ...
Mint.K's user avatar
  • 775
0 votes
1 answer
1k views

rsync - target bigger then source?

I have a harddrive for backups @ /mnt/old/ am making a copy of a folder (/mnt/old/backup/) that occupies a large part of the partition it's located on. $ df -h /mnt/old/ Filesystem Size Used ...
vrms's user avatar
  • 501
3 votes
1 answer
2k views

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 ...
Sinoosh's user avatar
  • 2,031
5 votes
1 answer
5k views

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
juggernaut108's user avatar
2 votes
0 answers
68 views

How to properly share a directory with an another group member? soft-link / hard-link

My scenario is simple. I am working with another team members, and I want to share my directory with others. I created a symbolic link of the shared directory in their home directories. ln -s ~/...
NeoJi's user avatar
  • 133
6 votes
2 answers
6k views

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 ...
Tim's user avatar
  • 32.8k
2 votes
0 answers
30 views

Show full-path for links [duplicate]

The real path for the folder TEMP DESK is: /home/username/Desktop/Dropbox/mystuff/TEMP DESK But when I click on the link that I created for it, it shows: /home/username/Desktop/Link to TEMP ...
Kasra's user avatar
  • 121
4 votes
1 answer
4k views

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 ...
FreeSoftwareServers's user avatar
1 vote
2 answers
2k views

Can you Link *Hard or Soft* to a directory and change the names of the files linked

So here's the scenario. I have a file torrent that gets updated and its so big its on a different disk, what I would like to do is create a link to where it would normally go if it wasn't so big and ...
FreeSoftwareServers's user avatar
2 votes
5 answers
1k views

Why not design having the softlink (symlink) and hardlink in the same "link"?

I haven't used hardlinks for a long time and never really needed them until I was asked in an interview. I read their difference from symlinks here: What is the difference between a hard link and a ...
George Pligoropoulos's user avatar
4 votes
2 answers
2k views

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 ...
Maythux's user avatar
  • 84.2k
3 votes
2 answers
1k views

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 ...
foxite's user avatar
  • 451
1 vote
1 answer
867 views

how to know how many hardlink count an inode has and where are they located

I need to know how many hard-links pointing to a certain inode. And where are those hard-links located in?
johan.i.zahri's user avatar
1 vote
1 answer
1k views

Does `update-alternatives --config` simply use `ln` to create hard links?

Does update-alternatives --config simply use ln to create hard links? For example, $ sudo update-alternatives --config javaws There are 3 choices for the alternative javaws (providing /usr/bin/javaws)...
Tim's user avatar
  • 25.1k
0 votes
1 answer
175 views

Are softlinks and hardlinks somewhat related to mutable and immutable objects (in java) in any sense?

While reading about linux,I got the following: Suppose that file1 already exists. A hard link, called file2, is created with the command: $ ln file1 file2 Note that two files now appear ...
lazarus's user avatar
  • 1,543
2 votes
1 answer
5k views

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 ...
Roledenez's user avatar
  • 1,185
2 votes
1 answer
338 views

Why does Nautilus show a file and its hard link as bigger than just the file?

When I create a hard link to a 2 KB file (called fun), Nautilus shows this hard link (called fun-hard) as a file with the same size. These two files are pointing to same inode so their combined ...
hunch's user avatar
  • 839
1 vote
1 answer
7k views

ln works on command line but not in script

I try this: for file in `ls -1 ../files/file_??_??.dat` ; do echo "$file" ; ln "$file" ; done And for every file it gives this error: ln: failed to create hard link ‘./file_01_am.dat’ => ‘../...
Aaron Harwood's user avatar
1 vote
1 answer
1k views

Hardlink count inconsistent with matching files

On searching for files that have hardlinks on my Portable HDD using the following command: $ find . ! -type d -links +1 -ls | sort -n I get an output of the following form (there are hundreds of ...
Rishi Dua's user avatar
  • 150
52 votes
5 answers
12k views

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 ...
Computernerd's user avatar
  • 1,381
7 votes
2 answers
2k views

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 ...
0xC0000022L's user avatar
  • 5,710
1 vote
1 answer
422 views

D-Link DWL-G122 NetWork

I'm starting downloading ubuntu now, and I have a doubt, my computer needs a USB stick with wireless network to achieve .. And anyone know where I can download the drivers for this model? Or does ...
user119558's user avatar
9 votes
2 answers
6k views

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 ...
To Do's user avatar
  • 15.5k
215 votes
6 answers
324k views

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 ...
Nischay's user avatar
  • 3,693