美文网首页
软硬链接 2021-10-25

软硬链接 2021-10-25

作者: 9_SooHyun | 来源:发表于2021-10-25 20:49 被阅读0次

symbolic link

A symbolic link contains a text string that is automatically interpreted and followed by the operating system as a path to another file or directory. This other file or directory is called the "target". The symbolic link is a second file that exists independently of its target. If a symbolic link is deleted, its target remains unaffected. If a symbolic link points to a target, and sometime later that target is moved, renamed or deleted, the symbolic link is not automatically updated or deleted, but continues to exist and still points to the old target, now a non-existing location or file. Symbolic links pointing to moved or non-existing targets are sometimes called broken, orphaned, dead, or dangling.

windows的快捷方式就是软链

hard link

In computing, a hard link is a directory entry that associates a name with a file in a file system. All directory-based file systems must have at least one hard link giving the original name for each file(基于目录的文件系统上的每个文件至少有一个硬链接,像我们在windows上天天看到的“文件路径”就是链接到文件的hard link). The term “hard link” is usually only used in file systems that allow more than one hard link for the same file.

Creating an additional hard link has the effect of giving one file multiple names (e.g. different names in different directories) all of which independently connect to the same data on the disk, none of which depends on any of the others.[1] This causes an alias effect: e.g. if the file is opened by any one of its names, and changes are made to its content, then these changes will also be visible when the file is opened by an alternative name. By contrast, a soft link or “shortcut” to a file is not a direct link to the data itself, but rather is a short file that contains the text of a file name, or a location that gives direct access to yet another file name within some directory. The name contained in or referred to by the soft link may either be a hard link or another soft link. This also creates aliasing, but in a different way.

一个文件可以有多个硬链,但它们链接到同一个文件,所以通过任意一个硬链对文件的修改会作用到其他硬链上,因为硬链只是同一文件的不同“名字”

相关文章

  • 软硬链接 2021-10-25

    symbolic link A symbolic link contains a text string that...

  • 软硬链接

    遇见的问题 先放遇见的问题——今天安装一台电脑上的virtualenv的时候,因为是常用命令,需要设置快捷方式 换...

  • linux 软硬链接

    当 我们需要在不同的目录,用到相同的文件时,我们不需要在每一个需要的目录下都放一个必须相同的文件,我们只要在某个固...

  • Linux 软硬链接

    软链接 ln -s 被软链接的源文件 链接名 是快捷方式 -s是软链接 尽量使用绝对路径 源文件删除后 软链接失效...

  • 软硬链接的区别

    软链接: ln -s 给目标目录创建一个软连接 1.软连接相当于文件的不同入口(快捷方式) 2.软连接依附于文件实...

  • Linux学习_软硬链接

    Linux中链接分为两种,一种是硬链接 Hard link,一种是软链接 Symbolic link。默认情况下,...

  • 8 其他命令

    1 find命令查找文件 2 软链接 3 硬链接 4 文件软硬链接示意图

  • Linux中的软硬链接

    Linux中的软硬链接 Linux文件的组成 在Linux一个文件由三部组成: 目录项(Dirent):包含文件名...

  • linux命令系列-ln(软硬链接)

    原文地址http://www.daileinote.com/computer/linux_cmd/10 ln命令可...

  • 6.8 软硬方式链接(ln)(P131-133)——《Linux

    软硬方式链接(P131-133) 一、两种链接 1. 硬链接 可以将它理解为一个“指向原始文件 inode 的指针...

网友评论

      本文标题:软硬链接 2021-10-25

      本文链接:https://www.haomeiwen.com/subject/jsysaltx.html