linux命令之创建符号连接-ln
生活随笔
收集整理的這篇文章主要介紹了
linux命令之创建符号连接-ln
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
由于linux編譯出的so經(jīng)常會(huì)在后面帶有版本號(hào),而程序加載的是不帶版本號(hào)的so,導(dǎo)致經(jīng)常出現(xiàn)so找不的情況,這個(gè)時(shí)候?yàn)閹О姹咎?hào)的so創(chuàng)建一個(gè)符號(hào)鏈接(軟鏈接)就好了。
在終端輸入ln --help查看一下這個(gè)命令的用法如下:
用法:ln [選項(xiàng)]... [-T] 目標(biāo) 鏈接名 (第一種格式)或:ln [選項(xiàng)]... 目標(biāo) (第二種格式)或:ln [選項(xiàng)]... 目標(biāo)... 目錄 (第三種格式)或:ln [選項(xiàng)]... -t 目錄 目標(biāo)... (第四種格式) In the 1st form, create a link to TARGET with the name LINK_NAME. In the 2nd form, create a link to TARGET in the current directory. In the 3rd and 4th forms, create links to each TARGET in DIRECTORY. Create hard links by default, symbolic links with --symbolic. By default, each destination (name of new link) should not already exist. When creating hard links, each TARGET must exist. Symbolic links can hold arbitrary text; if later resolved, a relative link is interpreted in relation to its parent directory.必選參數(shù)對(duì)長短選項(xiàng)同時(shí)適用。--backup[=CONTROL] 為每個(gè)已存在的目標(biāo)文件創(chuàng)建備份文件-b 類似--backup,但不接受任何參數(shù)-d, -F, --directory 創(chuàng)建指向目錄的硬鏈接(只適用于超級(jí)用戶)-f, --force 強(qiáng)行刪除任何已存在的目標(biāo)文件-i, --interactive prompt whether to remove destinations-L, --logical dereference TARGETs that are symbolic links-n, --no-dereference treat LINK_NAME as a normal file ifit is a symbolic link to a directory-P, --physical make hard links directly to symbolic links-r, --relative create symbolic links relative to link location-s, --symbolic make symbolic links instead of hard links-S, --suffix=SUFFIX override the usual backup suffix-t, --target-directory=DIRECTORY specify the DIRECTORY in which to createthe links-T, --no-target-directory treat LINK_NAME as a normal file always-v, --verbose print name of each linked file--help 顯示此幫助信息并退出--version 顯示版本信息并退出The backup suffix is '~', unless set with --suffix or SIMPLE_BACKUP_SUFFIX. The version control method may be selected via the --backup option or through the VERSION_CONTROL environment variable. Here are the values:none, off 不進(jìn)行備份(即使使用了--backup 選項(xiàng))numbered, t 備份文件加上數(shù)字進(jìn)行排序existing, nil 若有數(shù)字的備份文件已經(jīng)存在則使用數(shù)字,否則使用普通方式備份simple, never 永遠(yuǎn)使用普通方式備份Using -s ignores -L and -P. Otherwise, the last option specified controls behavior when a TARGET is a symbolic link, defaulting to -P.GNU coreutils online help: <http://www.gnu.org/software/coreutils/> 請(qǐng)向<http://translationproject.org/team/zh_CN.html> 報(bào)告ln 的翻譯錯(cuò)誤 Full documentation at: <http://www.gnu.org/software/coreutils/ln> or available locally via: info '(coreutils) ln invocation'
總結(jié)
以上是生活随笔為你收集整理的linux命令之创建符号连接-ln的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: c++构建工具之cmake使用小结
- 下一篇: linux工具之检测内存泄漏-valgr