The man page for the -f option of pgrep says:
What I thought it means is that the pattern you pass has to match the entire line in the CMD column of the ps command (including arguments), but that's not what I'm seeing.
When I run: 'ps -ef' here's part of the output:
But when I run: 'pgrep -f smb' I see this:
I would have expected it to not return anything (just like the -x option).
So what exactly is -f doing?
But I'm not sure what that means.The regular expression pattern should be matched against the full process argument string (obtained from the pr_psargs field of the /proc/nnnnn/psinfo file). If no -f option is specified, the expression is matched only against the name of the executable file (obtained from the pr_fname field of the /proc/nnnnn/psinfo file).
What I thought it means is that the pattern you pass has to match the entire line in the CMD column of the ps command (including arguments), but that's not what I'm seeing.
When I run: 'ps -ef' here's part of the output:
Code:
cpjust 26024 1 0 May20 ? 00:00:00 /usr/lib/gvfs/gvfsd-smb --spawner :1.5 /org/gtk/gvfs/exec_spaw/5
cpjust 26045 1 0 May20 ? 00:00:00 /usr/lib/gvfs/gvfsd-smb-browse --spawner :1.5 /org/gtk/gvfs/exec_spaw/7
cpjust 26054 1 0 May20 ? 00:00:01 /usr/lib/gvfs/gvfsd-smb --spawner :1.5 /org/gtk/gvfs/exec_spaw/9
Code:
26024
26045
26054
So what exactly is -f doing?