Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

rib00

macrumors newbie
Original poster
How do I determine if a particular command is available (installed)? I think that in Linux, this is roughly how it could be done

dpkg -l | grep "commandname"

dpkg is a package manager
l flag lists the packages that are installed
| sends the output to the next command
grep processes the input by searching for the word in quotes
grep prints the full line when it finds the search term on a line

or maybe just
commandname --version
prints the version of the command that is installed.

Maybe something like this?
pkgutil --pkgs | grep "commandname"
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.