Finding executable files
Leonard Chatagnier
lenc5570 at sbcglobal.net
Mon Jan 12 21:51:32 UTC 2009
--- On Mon, 1/12/09, NoOp <glgxg at sbcglobal.net> wrote:
> From: NoOp <glgxg at sbcglobal.net>
> Subject: Re: Finding executable files
> To: ubuntu-users at lists.ubuntu.com
> Date: Monday, January 12, 2009, 2:14 PM
> On 01/12/2009 09:17 AM, Matthew Flaschen wrote:
> > Leonard Bussey wrote:
> >> Hello all,
> >>
> >> Where can I find where Ubuntu puts the executable
> file to launch an
> >> application. I'm trying to set up IceWM and
> have to manually set up the
> >> menu items. Thank You.
> >
> > Do you know the executable name (e.g. gedit), but not
> the path
> > (/usr/bin/gedit)? If so, run e.g.:
> >
> > which gedit
> >
> > Otherwise, try to explain better (what do you know and
> what do you want
> > to know).
> >
> > Matt Flaschen
> >
>
> The only problem is 'which' will only return
> information if the command
> is in your PATH:
>
> DESCRIPTION
> which returns the pathnames of the files which would be
> executed in the
> current environment, had its arguments been given as
> commands in a
> strictly POSIX-conformant shell. It does this by
> searching the PATH
> for executable files matching the names of the arguments.
>
> For example, I have multiple instances of OpenOffice.org
> and StarOffice
> on my system:
>
> $ which soffice
> /usr/bin/soffice
> only returns the soffice in my path.
>
> However:
> ~$ locate -b "\soffice"
> /home/<user>/OOo241/opt/openoffice.org2.4/program/soffice
> /opt/ooo-dev3/program/soffice
> /opt/openoffice.org3/program/soffice
> /opt/staroffice8/program/soffice
> /opt/staroffice9/program/soffice
> /usr/bin/soffice
> /usr/lib/openoffice/program/soffice
>
> shows that I have multiple instances of soffice (an
> executable) that I
> can run. So I wouldn't necessarily rely on
> 'which' to provide the
> information if there is a possibility that the executable
> is outside of
> the PATH.
>
> I still get confused on path's & environment
> variables, so I have this
> page bookmarked:
> https://help.ubuntu.com/community/EnvironmentVariables
>
>
Just to add my two cents. Wajig is a neat, powerful front
end for apt which can do many things with apt.
wajig whichpkg <file name> will give you any/all the package
names that contain the file name. It's in the repos and if
your not familiar with it it is a good package to review and
use. Thanks for the info on environmental variables. I need
that tooo.
Leonard Chatagnier
lenc5570 at sbcglobal.net
More information about the ubuntu-users
mailing list