General
cancel
Showing results for 
Search instead for 
Did you mean: 

find out installed directory from command line

SOLVED
Go to solution
'chris'
Super Advisor

find out installed directory from command line

hi

how to find out installed directory from command line under linux,
for example, where was mozilla installed ?

kind regards
chris
5 REPLIES
Slawomir Gora
Honored Contributor
Solution

Re: find out installed directory from command line

Hej,
it depends on which linux system.
For system with rpm packages (RedHat, Fedora) you can do:
rpm -qa | grep mozilla | xargs rpm -ql

On Slackware linux
more /var/adm/packages/mozi*
Stuart Browne
Honored Contributor

Re: find out installed directory from command line

On most distributions these days, there is a package called 'which'.

This small application searches through the path for binaries matching the name passed to it, so you could do:

which mozilla

If what you're searching for is not in the path, then you've got the option of using the 'slocate' database:

locate mozilla

This will list all filenames in the 'slocate' database that matches the given name.

All that being said, if you need information about what files a given package has put onto your filesystem (on a Debian box), then things get a little messy. 'apt', 'dpkg' and 'dselect' are your friends though.
One long-haired git at your service...
'chris'
Super Advisor

Re: find out installed directory from command line

I have Debian Sarge Stable.
'chris'
Super Advisor

Re: find out installed directory from command line

I think "whereis" is, what I'm looking for.

SUSE 8.2:

# whereis mozilla
mozilla: /usr/X11R6/bin/mozilla /usr/bin/X11/mozilla /usr/X11/bin/mozilla /opt/mozilla/bin/mozilla.sh /usr/share/man/man1/mozilla.1.gz
# which mozilla
/usr/X11R6/bin/mozilla
# locate mozilla
-bash: locate: command not found


DEBIAN SARGE:

# whereis mozilla
mozilla: /usr/bin/mozilla /etc/mozilla /usr/lib/mozilla /usr/share/man/man1/mozilla.1.gz
# which mozilla
/usr/bin/mozilla
# locate mozilla
/usr/lib/mozilla/res/rdf/loading.gif
/usr/lib/mozilla/res/samples
/usr/lib/mozilla/res/samples/aform.css
/usr/lib/mozilla/res/samples/Anieyes.gif
/usr/lib/mozilla/res/samples/beeptest.html
/usr/lib/mozilla/res/samples/bform.css
/usr/lib/mozilla/res/samples/bg.jpg
/usr/lib/mozilla/res/samples/cform.css
/usr/lib/mozilla/res/samples/checkboxTest.xul
/usr/lib/mozilla/res/samples/colorpicker.xul
............................................
............................................
............................................

which shows only a startup script.

greetings
chris
Dave Falloon
Trusted Contributor

Re: find out installed directory from command line

Here are some useful debian commands:

dpkg -l

the package name is optional, this command outputs a table of packages installed on a machine with a brief description like so:

bofh:~# dpkg -l whois
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name Version Description
+++-====================-====================-========================================================
ii whois 4.7.0 the GNU whois client
bofh:~#

You can find out more about a specific package with this command :

dpkg -s

This prints out the summary and library information for a package.

dpkg -L

this tells you the actual location on the filesystem for everything that came in a package.

There are lots of other great switches to dpkg to help administer debian boxes.

--Dave
Clothes make the man, Naked people have little to no effect on society