Pgrep to find PIDs by name

Without any options, pgrep <name> only returns the PIDs of processes matching the name <name>. For example:

$ pgrep vim 
23084
23085

A more useful combination of flags is -fl:

-f: matches against the full argument list, not just the process name.

-l: long output, also prints the process name. When combined with -f prints the whole argument list.

Some examples:

$ pgrep -l vim
23084 nvim
23085 nvim
$ pgrep -fl vim
23084 lvim -u /Users/diegoallen/.local/share/lunarvim/lvim/init.lua main.go
23085 lvim --embed -u /Users/diegoallen/.local/share/lunarvim/lvim/init.lua main.go