pgrep doesn't perform full command line pattern matching

Hi! I need to get PID of some particular process and I wonder if I can use pgrep tool for this purpose. The problem is that pgrep doesn't perform pattern matching on the whole command line, even if I use -f key. Parsing output of ps command is not quite convenient... Also deamon, which PID I need to find, doesn't create any .pid files in /var/run. Any ideas and comments are greatly appreciated

pgrep -f should work. What pattern are you passing to it on the command line?

There is no requirement for a daemon to create a .pid file or, if it does create one, put it in /var/run.

Yeah, but it doesn't. Unfortunately, I can't provide the example of the output right now, but I can say that possible reason maybe in command line length - it may contain more than 255 characters

Say it is a recommended daemon behavior. Besides, it simplifies managing and troubleshooting, like in my case