So I'm relativity new to bash scripting. I've dabbled a bit but nothing too complex. So the scenario is I'm currently hosting a minecraft server for the community. It's heavily modded so sometimes bad things happen, In particular sometimes it crashes and freezes up to the point where killing the process is the only way to recover. Originally I wrote a script that would pgrep for a partial of the filename and kill the process. Now however I have multiple instances running so this will not work. Because of frequent updates I cannot do an exact name. So what I am looking for is a way to find the jar file in a particular directory and create a string variable of the filename so I can pgrep the exact name. so far I've come up with:
find '/path/to/jar/' -name 'partial-name*'
This works however shows the path as well, where I just need the file name. Hoping someone can help me out, point me in the right direction.