Linux common commands-61: ln

The ln command means link, and the function is to create a link for a certain file. There are two kinds of links here, one is a hard link, and the other is a symbolic link, also called a soft link.

A hard link is a copy of the source file, the same size as the source file, but does not actually take up any space. Soft links can be understood as shortcuts in windows , which can create soft links for folders.

Common parameters:

Example

 # 为文件test.py创建硬链接文件link.py ln test.py link.py # 为test.py创建软链接slink.py ln -s test.py slink.py # 通过ls -l来查看文件的链接情况ls -l slink.py # 删除链接文件unlink slink.py

This article is reprinted from https://xugaoxiang.com/2022/06/19/linux-cmds-61-ln/
This site is for inclusion only, and the copyright belongs to the original author.

Leave a Comment

Your email address will not be published.