国际访客建议访问 Primers 编程伙伴 国际版站点 > Bash 教程 > link 以获得更好的体验。

# Bash 的 link 命令

link [OPTION] SRC DEST

!subtitle:功能

创建文件的硬链接。

!subtitle:类型

可执行文件(/usr/bin/link),属于 coreutils

!subtitle:参数

  • OPTION 选项:

    • --help - 显示帮助

    • --version - 显示版本

  • SRC - 源文件

  • DEST - 目标文件(硬链接)

# 示例

$ link /opt/xxxx/cmd /usr/bin/cmd
  • 将文件 /opt/xxxx/cmd 链接到 /usr/bin/cmd

# 相关命令

命令 说明
ln 创建文件的链接(硬链接或符号链接)

# 推荐阅读

# 手册

LINK(1)                          User Commands                         LINK(1)

NAME
       link - call the link function to create a link to a file

SYNOPSIS
       link FILE1 FILE2
       link OPTION

DESCRIPTION
       Call  the  link  function  to  create a link named FILE2 to an existing
       FILE1.

       --help display this help and exit

       --version
              output version information and exit

AUTHOR
       Written by Michael Stone.

REPORTING BUGS
       GNU coreutils online help: <https://www.gnu.org/software/coreutils/>
       Report any translation bugs to <https://translationproject.org/team/>

COPYRIGHT
       Copyright © 2023 Free Software Foundation, Inc.   License  GPLv3+:  GNU
       GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
       This  is  free  software:  you  are free to change and redistribute it.
       There is NO WARRANTY, to the extent permitted by law.

SEE ALSO
       link(2)

       Full documentation <https://www.gnu.org/software/coreutils/link>
       or available locally via: info '(coreutils) link invocation'

GNU coreutils 9.4                 April 2024                           LINK(1)
本文 更新于: 2025-11-27 09:38:15 创建于: 2025-11-27 09:38:15