Simultaneous references and team ln
I can't get into the notion of a symbolic reference. Well, let's say I'm making files.
This is the first fileand file
this is the second file♪
Next, I'm taking the team.
ln file1.txt file2.txtAnd I'm being challenged by Linux, and he says he couldn't make a hard link. What do I have to add to the first file to make him mention the second? Almost all the examples on the Internet
ln -s♪ Why do you need an argument?
I'd be very grateful if anyone could explain the example.
I'd like to make my own contribution, because, literally, the day before yesterday, I know what's going on, and I'...
A simple, exhaustive example is the best explanation: as it is said, it's better to feel once more than to watch.
Let's start creating some sort of experimental folder somewhere.
Testsin the home catalogue:
Let's go into it.
Now we create a file in it.
echo 1 > source.txt
Time of reference...
Default (unspecified) team
lncreates a “hard link”:
ln source.txt hard-link.txt
A hard reference is, uh... what the hell? ♪
A hard link is a link file created with the Linux or Unix
lncommand that points to a file's inode♪
Source: http://www.computerhope.com/jargon/h/hardlink.htm ♪
Rigid reference - it's a file created by the Linux team (or Unix)
lnwhich indicates "inode" reference file.
OK.inode” file? ♪
Short for index node, an inode is information contained within a Unix system that contains details about each file, such as the node, owner, file, location of file, etc.
Source: http://www.computerhope.com/jargon/i/inode.htm ♪
Reduction fromindex node" ; inode - This information within the Unix system (inside the operating system), which contains a detailed description of each file; this description includes information on "node” file, information on the owner of the file, some information on the file itself, information on the location of the file, etc.
OK.node” file? ♪
A node or node address is a name or number that identifies a specific computer or terminal in a group of interconnected computers on a network.
Source: http://www.computerhope.com/jargon/n/nodeaddr.htm ♪
Node or node address - is a name or number that identifies a specific computer or terminal in a network-connected computer group.
I mean, this is file identifier in the system...
Uh-oh, sort of a theory that's more or less sorted...
So, we've got a file right now.
1and harsh reference to it
hard-link.txtsynchronized, no wonder.
If we transfer any of the files from the current directory within our mounting point, the second file will have no impact and synchronization will work (which means we've moved the file of course). Again, it's not surprising: the file continues to exist as long as there's a single reference to it.
So what's the problem? The implication is that, as mentioned above, the hard reference refers to the file index.inode) So, for example, if we remove any of the files and then create a file at the same location with the same name (and extension), it seems that it should be synchronized with another file, but not here, the link is lost: because the new file is a new index (also when copying the file creates a new file with a new index, and the connection is lost).
Let's go to symbolic references...
--symbolicA symbolic reference will be made:
ln -s source.txt soft-link.txt
Alternatively referred to as a soft link or symlink, a symbolic link is a file that links to another file or directory using its path. Unlike a hard link, a symbolic link can link to any file or directory on any computer. If you are more familiar with Microsoft Windows you can think of a symbolic link as a shortcut in Linux. In Linux and Unix symbolic links are created with the
lncommand. In the Windows command line you can use the
mklinkcommand to create symbolic link from the command line.
Source: http://www.computerhope.com/jargon/s/symblink.htm ♪
Alternative name soft link (mild/flex) or symlink (Symlin); symbolic reference - it's a file that connects with another file or directory using the latter's track(s). Unlike the hard reference, a symbolic reference may refer to any file or director located on any computer. If you know Microsoft Windows well, you can think of symbolic references as Linux labels. In Linux and Unix symbolic references are created by a team
ln♪ In the Windows command line, you can use the team.
mklinkto create a symbolic reference through a command line.
In other words, the symbolic reference refers file addressnot the file index.
If we move the symbolic link.
soft-link.txtthat's not gonna affect the original file.
source.txt, however, in an attempt to open the reference, it will be reported that the link has been breached and that it is proposed to delete the blank reference. And if we move the original file.
source.txtThat's the file.
soft-link.txt(this symbolic link) will become empty; however, if we create a new file with the same name as the original file.
source.txt() In the same directory, synchronization will re-establish and work.