10

I installed wireshark recently. I have no idea in which directory it was installed, but it's not in /opt.

How do I find where it's installed?

Farid
  • 708
  • 1
  • 5
  • 21
Alan Coromano
  • 850
  • 4
  • 16
  • 29

5 Answers5

16

Assuming you installed it from the repos:

$ dpkg -L wireshark wireshark-common 
/.
/usr
/usr/bin
/usr/bin/wireshark
/usr/share
/usr/share/menu
/usr/share/menu/wireshark
/usr/share/pixmaps
/usr/share/pixmaps/wsicon32.xpm
/usr/share/applications
/usr/share/applications/wireshark.desktop
/usr/share/doc
/usr/share/doc/wireshark
/usr/share/doc/wireshark/copyright
/usr/share/icons
/usr/share/icons/hicolor
/usr/share/icons/hicolor/48x48
/usr/share/icons/hicolor/48x48/apps
/usr/share/icons/hicolor/48x48/apps/wireshark.png
/usr/share/icons/hicolor/scalable
/usr/share/icons/hicolor/scalable/apps
/usr/share/icons/hicolor/scalable/apps/wireshark.svg
/usr/share/man
/usr/share/man/man1
/usr/share/man/man1/wireshark.1.gz
/usr/share/doc/wireshark/changelog.Debian.gz
/usr/share/doc/wireshark/README.Debian

/.
/usr
/usr/bin
/usr/bin/editcap
/usr/bin/text2pcap
/usr/bin/dumpcap
/usr/bin/rawshark
/usr/bin/mergecap
/usr/bin/capinfos
/usr/share
/usr/share/doc
/usr/share/doc/wireshark-common
/usr/share/doc/wireshark-common/README.Debian
/usr/share/doc/wireshark-common/copyright
/usr/share/lintian
/usr/share/lintian/overrides
/usr/share/lintian/overrides/wireshark-common
/usr/share/man
/usr/share/man/man4
/usr/share/man/man4/wireshark-filter.4.gz
/usr/share/man/man1
/usr/share/man/man1/mergecap.1.gz
/usr/share/man/man1/capinfos.1.gz
/usr/share/man/man1/dumpcap.1.gz
/usr/share/man/man1/editcap.1.gz
/usr/share/man/man1/text2pcap.1.gz
/usr/share/man/man1/rawshark.1.gz
/usr/share/doc/wireshark-common/changelog.Debian.gz
Oli
  • 289,791
  • 117
  • 680
  • 835
15

which wireshark will lead you to the executable. The output could ressemble this :

$ which wireshark
  /usr/bin/wireshark

Software never gets installed into /opt unless you yourself do that.

Farid
  • 708
  • 1
  • 5
  • 21
Rinzwind
  • 293,910
  • 41
  • 570
  • 710
  • it only works in this particular case. what if I was to install "my super program", how would I find its path? – Alan Coromano Jul 02 '13 at 15:22
  • @AlanDert `which "my super program"` will work. As will locate `locate "my super program"`. – Panther Jul 02 '13 at 16:16
  • @AlanDert why would it not work? :) `which` checks the current environment so it will find it if you can execute it. – Rinzwind Jul 02 '13 at 16:42
  • Some packages do install in `/opt`, though none in the `main` repositories do this. Examples: Google Chrome, Adobe Reader (Canonical partner repository), Spotify, etc. Please also note that it is even an requirement to install in `/opt` for MyApps (extras.ubuntu.com). http://developer.ubuntu.com/publish/my-apps-packages/ – gertvdijk Jul 02 '13 at 22:05
  • This answer is mostly wrong. `which program-name` returns the path to the *executable*, which can be completely different from the install location of a program(e.g. there is `/usr/bin/inkscape` but the installation is in `/usr/share/inkscape`). They are identical iff the program is a single executable without any need for system-wide resources/extensions/configurations. – Bakuriu Jul 03 '13 at 08:21
  • @Bakuriu all you do is repeat what is in the answer: as stated it will lead to the executable. Nothing more, nothing less. – Rinzwind Jul 03 '13 at 08:31
4

I would recommend going with @Oli's answer, if that works for you. For applications that you (for whatever reason) didn't install with the

You can examine the unity launcher icon, it may be able to tell you:

The launcher file will usually be located in /usr/share/applications/, and named something like my-application-launcher.desktop. If you don't know exactly what the file is called, use ls to examine the directory. (For your specific one, it is called wireshark.desktop.)

Once you know which one it is, examine its contents (anything from cat to gedit will work, but if you use gedit make sure to do it as gksu gksu gedit, not sudo gedit).

The file will contain an entry with something like Exec=command or Exec=/path/to/script.sh. If it only has a command, you can use which or locate (like @Rinzwind said) to get the full path for it. Another option is to use whereis to find the binary or source location.

The directory containing the launcher's target should be the installation directory for the program. If the launcher points to a shell script, sometimes examining its contents can reveal additional locations, if needed.

Running gksu nautilus when you get there will give you a windowed file browser with root permissions, meaning you can use it to copy/delete/edit any file, since normally installations are protected and will prevent you from modifying files as a normal user.

If that doesn't work, another option is to use find, to find anything with the same name, or grep, to find files containing the name.

However, you should only do this if you don't have any better alternatives. This can be a slow, tedious, mind-numbing process, especially since sometimes there is more than one location that stuff is installed to. If you can, use some other method.

AJMansfield
  • 585
  • 1
  • 5
  • 17
2

if nothing of the above works try locate. To do a locate-search on up to date information run updatedb before.

for more information, consult man locate and man updatedb

jerik
  • 121
  • 1
-1

locate keyword is best choice to check the installation directory of the program, look at the initial lines in the result of locate wireshark, and it will tell you all you require.

Eric Carvalho
  • 53,609
  • 102
  • 137
  • 162
Npayla
  • 1
  • 1