How to find package for installed file in Brew?

后端 未结 6 597
囚心锁ツ
囚心锁ツ 2020-12-23 13:37

How can I identify the package/formula for a given file, or a listing of all of a package\'s owned files, in Homebrew?

6条回答
  •  遥遥无期
    2020-12-23 14:00

    The package name can be determined based on the symbolic link which points to the binary (Cellar/PACKAGE/...), e.g.

    $ ls -la $(which awk) # => gawk
    lrwxr-xr-x 1 kenorb 28 May 20  2015 /usr/local/bin/awk -> ../Cellar/gawk/4.1.1/bin/awk
    
    $ ls -la $(which seq) # => coreutils
    lrwxr-xr-x 1 kenorb 14 Apr  8  2015 /usr/local/opt/coreutils/libexec/gnubin/seq -> ../../bin/gseq
    

提交回复
热议问题