In the Linux system, you can use ln
the command to make a soft link.
ln
The syntax of the command is as follows:
ln -s source_file link_name
Among them, source_file
is the path of the source file, and link_name
is the name and path of the soft link file.
For example, if you want to /home/user/file1
make a soft link to /home/user/link1
, you can enter the following command in the terminal:
ln -s /home/user/file1 /home/user/link1
This creates a link1
soft link file named , pointing to /home/user/file1
. It should be noted that the name and path of the soft link file cannot be the same as that of an existing file or directory, otherwise conflicts will occur.
You can also use relative paths to create soft links, for example:
cd /home/user
ln -s file1 link1
link1
This will create a soft link file named in the current directory , pointing to file1
the file.
ln -s
In short, it is very convenient to create a soft link through the command, so as to achieve quick access between files.