How to Find CLI Command For Program

Personally, I typically use two different utilities. You can use 'whereis ' followed by the program. If it's not in the path you can use 'find / -name ' followed by the program but that will be slower as it broadens the search. For example, you could try 'whereis vi' or 'find / -name vi'. Both have documentation available if you type in a search engine something like "freebsd man whereis" or "freebsd man find".
 
Sorry...my title could be misleading. What I meant is how do I find the command to enter into CLI to run the program. For example entering gimageview results in Command not found although it is listed in ports as such.
 
Looking at the files it installs in /usr/local/bin or /usr/local/sbin is a good bet.

pkg info -l gimageview | grep -E '/usr/local/s?bin'
 
Another thing one can do, if you know the port, is to look through the ports pkg-plist file. For example, if I expect openldap's slapd to be under /sbin and can't find it, looking at the port's pkg-plist shows me that there's a libexec/slapd, rather than an /sbin/slapd. (So you might modify tobik@'s command as well to include libexec).
 
Another thing one can do, if you know the port, is to look through the ports pkg-plist file. For example, if I expect openldap's slapd to be under /sbin and can't find it, looking at the port's pkg-plist shows me that there's a libexec/slapd, rather than an /sbin/slapd. (So you might modify tobik@'s command as well to include libexec).
That made it easy to track down too, thanks.
 
Back
Top