Jay Taylor's notes
back to listing indexmacos - How to get Brew formula from the filename of installed binary? - Ask Different
[web search]
Original source (apple.stackexchange.com)
Clipped on: 2023-12-13
Ask Different is a question and answer site for power users of Apple hardware and software. It only takes a minute to sign up.
Sign up to join this community
It is not part of Homebrew proper but you can inspect the code yourself.
-
1Not a user of Homebrew as I prefer MacPorts, but this is really cool. +1– AllanApr 5, 2020 at 5:27
-
1Thank you. So, basically what your command does, is to go into
/usr/local/bin
, search for a symlink matching the supplied filename, follow the symlink into/usr/local/Cellar
to get the name of the formula that's in the absolute path, e.g.:/usr/local/bin/ragg2@ -> ../Cellar/radare2/4.3.1/bin/ragg2
?– ShuzhengApr 5, 2020 at 5:33 -
@Shuzheng Mostly, yes. It also honors
/usr/local/sbin
, and I plan to add support for Cask- and npm-installed executables.– SynoliApr 5, 2020 at 19:30 -
1You may also want to check out github.com/Homebrew/homebrew-command-not-found. It provides a
brew which-formula
command, which may support not-yet-installed packages, too. (I didn’t know it existed until after I wrotebrew whence
.)– SynoliApr 5, 2020 at 19:34 -
brew whence
does not work for the keg-only llvm formula. The "comes from" column is blank.brew whence /usr/local/opt/llvm/lib/libc++.a
/usr/local/opt/llvm/lib/libc++.a (not a link)
– stragerJan 13, 2021 at 9:35
You must log in to answer this question.
- The Overflow Blog
-
-
- Featured on Meta
-
-
Related
Hot Network Questions
- Looking for an accurate Apple II(e) character set - in particular, what is CHR$(133)?
- Terry Tao didn't list the "dozens and dozens of wave equations out there" in his talk, but is there such a list somewhere?
- Understanding Header Structure in Binary
- Does being swallowed end a grapple?
- How can I pay in Vietnam?
- When is it appropriate to mix 74LSxx components with original TTL 74xx?
- Numbers in love - can we reproduce Giacomo Balla's extruded digits?
- PSE Advent Calendar 2023 (Day 12): A peaceful tree
- How do I calculate the normals of a point group?
- What was Baby Jesus ' redeemed with ' at the Temple?
- Does an electric heater lose efficiency if the elements are rusty/corroded?
- Is it Bad Technique to Use One Finger for Two Keys in Sequence?
- Is there a way to render a 2D animation of a 3D object?
- Book last read in 2000 involving a boy named Zeek I think who was training to be a wizard and visits a dimension called the bazaar
- Is a contract written by a language model valid?
- Help me identity some old Mini-Series or anthology. Includes Truth Serum, Mysterious Egg and superspeed
- Received a job offer, but recruiter is behaving unprofessionally
- Asterisk in file path in MacOS Ventura
- Cyclically Sort a List
- Can you beat random?
- A function to convert 0-2000 milliseconds to a double representing a fraction of a second
Apple is a trademark of Apple Inc., registered in the US and other countries. This site is not affiliated with or endorsed by Apple Inc. in any way.