Ln command
This command creates a link between files. This operation is actually to specify another name that can be used to access an existing file in the system. For this new file name, we can specify different access permissions for it to control information sharing and security issues. If the link points to a directory, you can use the link to directly enter the directory to be linked without having to create a lot of path names. Besides, even if we delete this link, the original directory will not be damaged.
Syntax: ln [Option] target [Link name]
Ln [Option] target directory
There are two types of links: hard link and symbolic link ). When creating a hard link, the linked file and the linked file must be in the same file system, and cannot establish a hard link to the directory. This problem does not exist for symbolic links. By default, ln generates hard links.
In the case of hard links, the "target" in the parameter is linked to the [Link name]. If the [Link name] is a directory name, the system creates one or more link files with the same name as the "target" under the directory, the content of the linked file is exactly the same as that of the linked file. If the [Link name] is a file, the user will be notified that the file already exists and will not be linked. If multiple "target" parameters are specified, the last parameter must be a directory.
If the-s option is added to the ln command, a symbolic link is established. If the [Link name] already exists but is not a directory, no link will be made. [Link name] can be any file name (including path), a directory, and allow it to be different from the target file system. If the [Link name] is an existing directory, the system creates one or more files with the same name as the "target" in the directory, the new file actually points to the symbolic link file of the original "target.
Example: $ ln-s lunch/home/Xu
The user creates a symbolic link/home/Xu for the file lunch in the current directory.
Delete a symbolic link. delete a symbolic link if it is created.
Rm-RF symbolic_name note not Rm-RF symbolic_name/