Finding plugins directory in a bash script

I'm using PyCharm and I need to execute a plugin jar from a bash script.

The docs say the plugins can be found in Linux at


Or, when the IDE was installed using the Toolbox App, they can be found using the menu Help | Edit Custom VM Options, which opens a file like 231.9011.38.vmoptions containing a line like


That's ok when done manually.

The problem when trying to find 231.9011.38.vmoptions without the IDE is that it's located exactly in the same place you are trying to find:


A search for .plugins directories under ~/.local/share/JetBrains finds


So the Toolbox App maintains two versions for some reason. Selecting the most recent solves the problem.

But i guess there must be a more straightforward way to find the plugins directory from a bash script.