"command not found: tshark" error on command line when wireshark app is already downloaded and running

Viewed 4502

I would like to use tshark from the command line. I have been using the Wireshark application on Mac OSX (10.15.3), but tshark in Terminal gave me the error:

command not found: tshark

I tried moving the tshark and tshark.dSYM files from the Package Contents of the application (Wireshark.app/Contents/MacOS/) to /usr/local/bin because of a comment I found online. Now I'm getting the error:

dyld: Library not loaded: @rpath/libwireshark.13.dylib
  Referenced from: /usr/local/bin/tshark
  Reason: image not found
zsh: abort      tshark

Seems like progress, but I'm not sure what other files need to be moved to where to be able to run tshark commands from Terminal?

1 Answers

You can solve the problem by using symbolic links.
Create a symbolic link for tshark in /usr/local/bin as such.

ln -s /Applications/Wireshark.app/Contents/MacOS/tshark /usr/local/bin/tshark

Now if you run tshark -v you should see the current version of tshark installed

Related