linux命令ln介绍(11)

  • A+
所属分类:Rebuilding

ln命令主要用于建立连接、软连接or硬连接。
参数:

-L, --logical:建立一个硬连接
-s, --symbolic:建立一个软连接(符号连接)
-d, -F, --directory:允许root建立文件夹硬连接,不过由于系统限制一般不允许
-f, --force:删除现有目标文件
-i, --interactive:提示用户是否删除目标文件

其他参数:

-n, --no-dereference
note:treat destination that is a symlink to a directory as if it were a normal file

--backup[=CONTROL]
note:make a backup of each existing destination file

-b:like --backup but does not accept an argument

-S, --suffix=SUFFIX
note:override the usual backup suffix

-t, --target-directory=DIRECTORY
note:specify the DIRECTORY in which to create the links

-T, --no-target-directory
note:treat LINK_NAME as a normal file

-v, --verbose
note:print name of each linked file

案例:

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: