Ln is Linux
A very important command. Its function is to create a synchronization link for a file in another location. The most common parameter of this command is-S. Its usage is as follows:
The target file-S of the Ln-S source file is symbolic.
Example: ln-S/lib/LSB/usr/LJ
That is, create an LJ file pointing to the/lib/LSB directory under the USR directory.
When
When we need to use the same file in different directories, we do not need to put a file that must be the same under each required directory. We only need to put it in a fixed directory, put the file, and then
You can use the ln command link in the directory without occupying disk space repeatedly. Example: ln-S/bin/less
/Usr/local/bin/less-S
It is the symbol (symbolic. There are two points to note: first, the ln command will keep the synchronization of each link file. That is to say, no matter which one you change, other files will happen.
The changes are the same. Second, there are two types of LN links: Soft link and hard link. The soft link is ln-s **
**, It will only generate a file image at the position you selected, without occupying disk space, hard link ln *****, no parameter-s,
It will generate a file with the same size as the source file at the position you selected. Both soft links and hard links keep the file Changing synchronously. Soft links can be cross-partition, but hard links can only be in the same partition.
. If you use ls to view a directory and find that some files are followed by a @ symbol, it is a file generated using LN command
-L command to view, you can see the display link path when we need to use the same file in different directories, we do not need to put the same file in every required directory,
We only need to put the file in a fixed directory, and then use the ln command link in other directories, without occupying disk space repeatedly. Example: ln-S
/Bin/less/usr/local/bin/less
Note:
First, the ln command will keep the synchronization of each link file. That is to say, other files will change the same no matter which one you have changed;
The
2. There are two types of LN links: Soft link and hard link. The soft link is ln-s *****. It will only generate a file image at your selected location, does not occupy disk space, hard link ln
* ***, No parameter-s,
It will generate a file with the same size as the source file at the position you selected. Both soft links and hard links keep the file Changing synchronously. Soft links can be cross-partition, but hard links can only be in the same partition.
.
Third, the directory cannot create a hard link, but you can create a soft link.