pgrep(1) on Solnix vs Linux and the BSDs

On Solnix, pgrep is the illumos pgrep at /usr/bin/pgrep, and the FreeBSD and NetBSD pages describe it as modelled on the Solaris utility. It adds Solnix-specific selectors (-J project, -T task, -c contract, -z zone). Its -c takes a contract ID list, whereas Linux -c prints a count and FreeBSD -c selects a login class.

What Solnix runs

A default Solnix system runs the illumos pgrep at /usr/bin/pgrep. No other variants are shipped. pkill is documented on the same page. The bundle's Linux page also covers pidwait, which the Solnix page does not.

Differences

Compared withTopicWhat differs
Linux, FreeBSD-c meaningSolnix pgrep -c ctidlist matches process contract IDs. Linux -c prints a count of matching processes. FreeBSD -c class matches a login class. NetBSD has no -c. A script using -c gets different results on each system.
Source: Solnix pgrep(1) -c; Linux pgrep(1) -c, --count; FreeBSD pgrep(1) -c; NetBSD pgrep(1) SYNOPSIS
Linux, FreeBSD, NetBSDzone, project and task selectorsSolnix has -z zoneidlist, -J projidlist and -T taskidlist. The Linux, FreeBSD and NetBSD pages have none of these. FreeBSD has -j jail for jails. Linux has --cgroup and --ns for cgroups and namespaces.
Source: Solnix pgrep(1) -z, -J, -T; FreeBSD pgrep(1) -j; Linux pgrep(1) --cgroup, --ns
Linux, FreeBSD, NetBSD-F pidfile missingSolnix pgrep has no -F pidfile option, so it cannot read PIDs from a file. Linux, FreeBSD and NetBSD all document -F, and -L means the pidfile must be locked.
Source: Solnix pgrep(1) SYNOPSIS; Linux pgrep(1) -F, -L; FreeBSD pgrep(1) -F, -L; NetBSD pgrep(1) -F, -L
Linux, FreeBSD, NetBSD-i and -q missingThe Solnix page documents neither -i (case-insensitive match) nor -q (no output). Linux and NetBSD document both. FreeBSD documents both. Use the exit status or redirect output to /dev/null on Solnix.
Source: Solnix pgrep(1) SYNOPSIS and OPTIONS; Linux pgrep(1) -i, -q, --quiet; FreeBSD pgrep(1) -i, -q; NetBSD pgrep(1) -i, -q
Linux, FreeBSD-a meaningSolnix has no -a. On Linux, -a lists the full command line. On FreeBSD, -a includes the ancestors of pgrep in the match list. Solnix -l with -f shows the full argument string.
Source: Solnix pgrep(1) -l, -f; Linux pgrep(1) -a, --list-full; FreeBSD pgrep(1) -a
FreeBSD, NetBSD-l with -fOn FreeBSD and NetBSD, -l with -f prints the full argument list. On Solnix, -l prints pr_psargs if -f is given, else pr_fname, which is also the full argument string with -f. In FreeBSD pkill, -l shows the kill command used.
Source: Solnix pgrep(1) -l; FreeBSD pgrep(1) -l; NetBSD pgrep(1) -l
FreeBSD, NetBSD-o and -n coverageSolnix has both -n (newest) and -o (oldest), which cannot be used together. The NetBSD page documents -n only and no -o. FreeBSD and Linux document both.
Source: Solnix pgrep(1) -n, -o; NetBSD pgrep(1) SYNOPSIS and -n; FreeBSD pgrep(1) -n, -o
Linux, FreeBSD, NetBSDmultiple patterns and pattern requirementThe Solnix synopsis shows a single optional pattern. The FreeBSD and NetBSD synopses show pattern ... as a required operand. Linux shows pattern as required.
Source: Solnix pgrep(1) SYNOPSIS; FreeBSD pgrep(1) SYNOPSIS; NetBSD pgrep(1) SYNOPSIS; Linux pgrep(1) SYNOPSIS
Linux, FreeBSD, NetBSDhow process data is readSolnix reads /proc/nnnnn/psinfo (pr_fname, pr_psargs), and string lengths are limited by <sys/procfs.h>. FreeBSD uses kvm(3) and keeps only the first 19 characters of the command name. NetBSD also uses kvm(3).
Source: Solnix pgrep(1) -f, NOTES; FreeBSD pgrep(1) DESCRIPTION, IMPLEMENTATION NOTES; NetBSD pgrep(1) IMPLEMENTATION NOTES
FreeBSDself and ancestors excludedSolnix never matches the running pgrep or pkill process itself, and the page does not mention ancestors. FreeBSD also excludes all direct ancestors unless -a is given.
Source: Solnix pgrep(1) NOTES; FreeBSD pgrep(1) DESCRIPTION, -a
Linux, FreeBSD, NetBSDterminal name formatSolnix -t takes the path after /dev/, such as term/a or pts/0. FreeBSD and NetBSD also accept ttyxx or short forms and a single dash for no terminal. Solnix does not document the dash.
Source: Solnix pgrep(1) -t; FreeBSD pgrep(1) -t; NetBSD pgrep(1) -t
Linux, FreeBSD, NetBSDdefunct processesSolnix states that defunct processes are never matched. The Linux, FreeBSD and NetBSD pages do not say this. Linux has -r to match by run state, including Z.
Source: Solnix pgrep(1) NOTES; Linux pgrep(1) -r, --runstates

Standards

  • POSIX: pgrep is not a POSIX.1-2024 utility.
  • NetBSD: pkill and pgrep first appeared in NetBSD 1.6, modelled after utilities of the same name that appeared in Sun Solaris 7.

Writing portable scripts

  • Use only -f, -x, -v, -n, -l, -u, -U, -G, -g, -s, -t, -P and -d. Avoid -c, -a, -o and -i, which differ or are missing.
  • Test the exit status (0 matched, 1 none, 2 bad options, 3 error) rather than parsing output. All four pages document the same codes.

Every difference here is taken from the manual pages linked above: Solnix's published page, Linux (man-pages and the GNU and util-linux manuals), FreeBSD, OpenBSD and NetBSD. Each row names its source. Where a manual is silent, this page is too. Compiled 2026-10-26. Found a mistake? Mail hackers@lists.solnix.io.