我如何找出酿造链接的终点?


13

brew link将符号链接放置在各处。如何查找特定包装的位置?

例如,我通过brew安装了cairo。brew list cairo显示我已安装文件的列表。当我链接开罗时,brew将创建符号链接。

$ brew link cairo                                          
Linking /usr/local/Cellar/cairo/1.14.0... 28 symlinks created

我如何找出这些符号链接在哪里?

Answers:


10

符号链接通常位于中/usr/local/,并由定义brew --prefix。要查看应用符号链接到的位置(wget以示例为例),

$ brew link wget --dry-run
Warning: Already linked: /usr/local/Cellar/wget/1.16.1
To relink: brew unlink wget && brew link wget

根据brew手册页:

If  --dry-run or -n is passed, Homebrew will list all files which would be linked or which would be deleted by brew link --overwrite, but will not actually link or delete any files.

要查看所有文件的位置,请使用list [formula] --verbose类似的选项

$ brew list wget --verbose
/usr/local/Cellar/wget/1.16.1/AUTHORS
/usr/local/Cellar/wget/1.16.1/bin/wget
/usr/local/Cellar/wget/1.16.1/ChangeLog
/usr/local/Cellar/wget/1.16.1/COPYING
/usr/local/Cellar/wget/1.16.1/INSTALL_RECEIPT.json
/usr/local/Cellar/wget/1.16.1/NEWS
/usr/local/Cellar/wget/1.16.1/README
/usr/local/Cellar/wget/1.16.1/share/info/wget.info
/usr/local/Cellar/wget/1.16.1/share/man/man1/wget.1

3
值得一提的是,您必须先取消链接才能与链接--dry-run,否则brew将抱怨“已链接”。
布兰登2015年

1

如果包已链接,则可以列出现有链接:

brew unlink <formulae> --dry-run

要获取有关链接的更多信息:

brew unlink <formulae> --dry-run | xargs ls -l
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.