# How to Find CLI Command For Program



## tripseven (Feb 16, 2018)

Like gimageview


----------



## Ryan Root (Feb 16, 2018)

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".


----------



## tripseven (Feb 16, 2018)

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.


----------



## tobik@ (Feb 16, 2018)

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'`


----------



## tripseven (Feb 16, 2018)

tobik@ said:


> 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'`


Thats what I needed, thanks.


----------



## scottro (Feb 16, 2018)

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).


----------



## tripseven (Feb 16, 2018)

scottro said:


> 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.


----------

