PROCSTAT(1)
๐
PROCSTAT(1) โ the procstat manual, but make it make sense โจ
okay so bestie, this is the General Commands Manual entry for procstat, and honestly? it's a whole buffet of process info and I'm obsessed. grab a snack ๐
๐ธ NAME ๐ธ
procstat โ get detailed process information. that's it, that's the vibe. she tells you everything about your processes, no cap ๐
โจ SYNOPSIS โจ
procstat [--libxo] [-h] [-M core] [-N system] [-w interval] command
[pid ... | core ...]
procstat [--libxo] -a [-h] [-M core] [-N system] [-w interval] command
procstat [--libxo] [-h] [-M core] [-N system] [-w interval] [-b | -c |
-e | -f [-C] | -i [-n] | -j [-n] | -k [-k] | -l | -r [-H] | -s
| -S | -t | -v | -x] [pid ... | core ...]
procstat [--libxo] -a [-h] [-M core] [-N system] [-w interval] [-b | -c
| -e | -f [-C] | -i [-n] | -j [-n] | -k [-k] | -l | -r [-H] |
-s | -S | -t | -v | -x]
procstat [--libxo] -L [-h] [-M core] [-N system] [-w interval] core ...
pargs [--libxo] pid ...
penv [--libxo] pid ...
pwdx [--libxo] pid ...
๐ฆ DESCRIPTION ๐ฆ
so the procstat utility is your girl for displaying detailed information about the processes โ specifically the ones you point at with the pid arguments, or, if you pass the -a flag, literally all of them ๐. she can also pull info out of a process core file, if you hand her the core file as the argument. versatile icon behavior.
the pargs, penv and pwdx utilities display the arguments, environment, and current working directory (respectively, bestie, keep up ๐
) of the process specified by the pid argument. they mimic the behavior of Solaris utilities of the same names โ a little retro tribute, we love a homage.
if the --libxo flag is specified, the output is generated via libxo(3) in a selection of different human and machine readable formats. see xo_options(7) for the details on command line arguments. fancy AND functional, we stan.
the following commands are available for procstat:
advlockโ print information about advisory locks on files. all three types of locks are listed: BSD-stylelockf(2), POSIX-stylefcntl(2)F_SETLK, and remotelockd(8)locks used by NFSv3.
โ ๏ธ heads up bestie: neither the-aoption nor apidlist can be used to limit the display of the locks. mostly because some types of locks don't have local (or any) owning processes. it's giving "she answers to no one" ๐ญ
argument(s)|-cโ display command line arguments for the process. substring commands are accepted ๐auxv|-xโ display ELF auxiliary vector for the process.basicโ print basic process statistics. this is the default, so if you don't pick anything she just does this. lowkey the main character โจbinary|-bโ display binary information for the process. substring commands are accepted.credential(s)|-sโ display security credential information for the process. substring commands are accepted.cpuset|cs|-Sโ display the cpuset information for the thread.environment|-eโ display environment variables for the process. substring commands are accepted.file(s)|fd(s)|-fโ display file descriptor information for the process. if the-Csubcommand flag is used then additional capability information is printed. okay capability queen ๐kqueue(s) [-v]โ display the events registered in the process kqueues. the filter name, filter-specific identifier, flags, filter-specific flags, system and user data, and event status are displayed. if the-vverbose flag is provided to the subcommand, the values of theextarray are displayed as well. thorough!
for flags, a string is printed consisting of the following symbols corresponding to set flags:
OโEV_ONESHOTCโEV_CLEARRโEV_RECEIPTDโEV_DISPATCHdโEV_DROP1โEV_FLAG12โEV_FLAG2
for status:
AโKNOTE_STATUS_ACTIVEQโKNOTE_STATUS_QUEUEDDโKNOTE_STATUS_DISABLEDdโKNOTE_STATUS_DETACHEDKโKNOTE_STATUS_KQUEUE
kstack|-kโ display the stacks of kernel threads in the process, excluding stacks of threads currently running on a CPU in userspace. if the-vsubcommand option is used (or the command flag is repeated), function offsets as well as function names are printed. double it up, get more info ๐ฅpargsโ display arguments for the process.penvโ display environment variables for the process.ptlwpinfo|-Lโ display LWP info for the process pertaining to its signal driven exit.pwdxโ display current working directory for the process.rlimit|-lโ display resource limits for the process.rlimitusageโ display the usage of the resource limits for the process.rusage|-rโ display resource usage information for the process. if the-v(or-H) subcommand flag is used then per-thread statistics are printed, rather than per-process statistics. the second field in the table will list the thread ID to which the row of information corresponds. slay, granularity โจsignal(s)|-iโ display signal pending and disposition information for the process. if the-nsubcommand option is used, the signal numbers are shown instead of signal names. substring commands are accepted.thread(s)|-tโ display thread information for the process.tsignal(s)|-jโ display signal pending and blocked information for the process's threads. if the-nsubcommand option is used, the signal numbers are shown instead of signal names. substring commands are accepted.vm|-vโ display virtual memory mappings for the process.
all options generate output in the format of a table, the first field of which is the process ID to which the row of information corresponds. the -h flag may be used to suppress table headers โ for when you simply don't need the labels, iykyk ๐
the -w flag may be used to specify a wait interval at which to repeat the printing of the requested process information. if the -w flag is not specified, the output will not repeat. she said "once and done" ๐
๐ important one, bestie: information for VM, file descriptor, and cpuset options is available only to the owner of a process or the superuser. a cpuset value displayed as -1 means that the information is either invalid or not available. not her fault, she's just gatekept.
๐ Binary Information
display the process ID, command, and path to the process binary:
PIDโ process IDCOMMโ commandOSRELโosreldatefor process binaryPATHโ path to process binary (if available)
๐ Command Line Arguments
display the process ID, command, and command line arguments:
PIDโ process IDCOMMโ commandARGSโ command line arguments (if available)
๐ Environment Variables
display the process ID, command, and environment variables:
PIDโ process IDCOMMโ commandENVIRONMENTโ environment variables (if available)
๐ง File Descriptors
display detailed information about each file descriptor referenced by a process, including the process ID, command, file descriptor number, and per-file descriptor object information, such as object type and file system path. by default, the following information will be printed:
PIDโ process IDCOMMโ commandFDโ file descriptor number orcwd/root/jailTโ file descriptor typeVโ vnode typeFLAGSโ file descriptor flagsREFโ file descriptor reference countOFFSETโ file descriptor offsetPROโ network protocolNAMEโ file path or socket addresses (if available)
the following file descriptor types may be displayed:
eโ POSIX semaphoreEโeventfdfโ fifohโ shared memoryiโinotifydescriptorkโ kqueuemโ message queuePโ process descriptorpโ pipesโ sockettโ pseudo-terminal mastervโ vnode
the following vnode types may be displayed:
-โ not a vnodebโ block devicecโ character devicedโ directoryfโ fifolโ symbolic linkrโ regular filesโ socketxโ revoked device
the following file descriptor flags may be displayed:
rโ readwโ writeaโ appendsโ asyncfโ fsyncnโ non-blockingdโ direct I/Olโ lock held
if the -C flag is specified, the vnode type, reference count, and offset fields will be omitted, and a new capabilities field will be included listing capabilities, as described in cap_rights_limit(2), present for each capability descriptor. she switches up her whole format for you, flexible queen ๐
the following network protocols may be displayed (grouped by address family):
AF_INET, AF_INET6
ICMโIPPROTO_ICMP; seeicmp(4).IP?โ unknown protocol.RAWโIPPROTO_RAW; seeip(4).SCTโIPPROTO_SCTP; seesctp(4).TCPโIPPROTO_TCP; seetcp(4).UDPโIPPROTO_UDP; seeudp(4).
AF_LOCAL
UDDโ Datagram socket.UDSโ Stream socket.UDQโ Sequential Packet Stream socket.UD?โ unknown protocol.
AF_DIVERT
IPDโ Divert socket; seedivert(4).?โ unknown address family.
๐ Signal Disposition Information
display signal pending and disposition for a process:
PIDโ process IDCOMMโ commandSIGโ signal nameFLAGSโ process signal disposition details, three symbols:Pโ if signal is pending in the global process queue;-otherwise.Iโ if signal delivery disposition isSIG_IGN;-otherwise.Cโ if the signal will be caught;-otherwise.
if -n switch is given, the signal numbers are shown instead of signal names.
๐ฅ Thread Signal Information
display signal pending and blocked for a process's threads:
PIDโ process IDTIDโ thread IDCOMMโ commandSIGโ signal nameFLAGSโ thread signal delivery status, two symbols:Pโ if signal is pending for the thread,-otherwiseBโ if signal is blocked in the thread signal mask,-if not blocked
the -n switch has the same effect as for the -i switch: the signal numbers are shown instead of signal names.
๐ซถ Kernel Thread Stacks
display kernel thread stacks for a process, allowing further interpretation of thread wait channels. if the -k flag is repeated, function offsets, not just function names, are printed.
โญ this feature requiresoptions STACKoroptions DDBto be compiled into the kernel. no kernel option, no stack tea, sorry bestie ๐ญ
PIDโ process IDTIDโ thread IDCOMMโ commandTDNAMEโ thread nameKSTACKโ kernel thread call stack
๐ Resource Limits
display resource limits for a process:
PIDโ process IDCOMMโ commandRLIMITโ resource limit nameSOFTโ soft limitHARDโ hard limit
๐ธ Resource Usage
display resource usage for a process. if the -H flag is specified, resource usage for individual threads is displayed instead.
PIDโ process IDTIDโ thread ID (if-His specified)COMMโ commandRESOURCEโ resource nameVALUEโ current usage
๐ Security Credentials
display process credential information:
PIDโ process ID, the classic ๐COMMโ command, aka what program is thisEUIDโ effective user IDRUIDโ real user IDSVUIDโ saved user IDEGIDโ effective group IDRGIDโ real group IDSVGIDโ saved group IDUMASKโ file creation mode maskFLAGSโ credential flagsGROUPSโ group set
The following credential flags may be displayed:
Cโ capability mode โจ
๐งต Thread Information
This one gives you per-thread tea โ โ process ID, per-thread ID, name, CPU, and execution state:
PIDโ process IDTIDโ thread IDCOMMโ commandTDNAMEโ thread nameCPUโ current or most recent CPU run onPRIโ thread prioritySTATEโ thread stateWCHANโ thread wait channel
๐บ๏ธ Virtual Memory Mappings
Process virtual memory mappings, bestie โ addresses, mapping meta-data, and mapped object info:
PIDโ process IDSTARTโ starting address of mappingENDโ ending address of mappingPRTโ protection flagsRESโ resident pagesPRESโ private resident pagesREFโ reference countSHDโ shadow page countFLAGโ mapping flagsTPโ VM object type
The following protection flags may be displayed:
rโ readwโ writexโ execute
The following VM object types may be displayed:
--โ noneddโ dead ๐dfโ defaultdvโ devicemdโ device with managed pages (GEM/TTM)phโ physicalsgโ scatter/gatherswโ swapvnโ vnodegdโ guard (pseudo-type)
The following mapping flags may be displayed:
Cโ copy-on-writeNโ needs copySโ one or more superpage mappings are usedDโ grows down (top-down stack)Uโ grows up (bottom-up stack)Wโ pages in this range are locked bymlock(2)ormlockall(2)
๐ง ELF Auxiliary Vector
ELF auxiliary vector values, coming right up ๐
PIDโ process IDCOMMโ commandAUXVโ auxiliary vector nameVALUEโ auxiliary vector value
๐ Advisory Lock Information
RWโ Read/Write type,ROfor read,RWfor write lockTYPEโ Type of the lock, one ofFLOCKforflock(2),FCNTLforfcntl(2),LOCKDfor remotePIDโ Process id of the owner, forFCNTLand remote typesSYSIDโ Remote system id if applicableFSIDโ File system id where the locked file resize <span>๐ญ</span> (that's literally what the page says, no cap โ we're quoting it verbatim)RDEVโrdevfor the file systemINOโ Unique file identifier (inode number) of the locked file on the file systemSTARTโ Start offset of the locked rangeLENโ Length of the locked range. Zero means till EOFPATHโ If available, the path of the locked file
๐ช EXIT STATUS
The procstat utility exits 0 on success, and >0 if an error occurs. That's it, that's the vibe check โจ
๐ธ EXAMPLES
Show binary information about the current shell:
$ procstat binary $$
PID COMM OSREL PATH
46620 bash 1201000 /usr/local/bin/bash
Same as above but showing information about open file descriptors โ lowkey obsessed with how clean this output is:
$ procstat files $$
PID COMM FD T V FLAGS REF OFFSET PRO NAME
46620 bash text v r r------- - - - /usr/local/bin/bash
46620 bash ctty v c rw------ - - - /dev/pts/12
46620 bash cwd v d r------- - - - /tmp
46620 bash root v d r------- - - - /
46620 bash 0 v c rw------ 7 372071 - /dev/pts/12
46620 bash 1 v c rw------ 7 372071 - /dev/pts/12
46620 bash 2 v c rw------ 7 372071 - /dev/pts/12
46620 bash 255 v c rw------ 7 372071 - /dev/pts/12
Show the arguments used to launch init(8):
$ procstat arguments 1
PID COMM ARGS
1 init /sbin/init --
Extract binary information from a core dump:
$ procstat binary core.36642
PID COMM OSREL PATH
36642 top 1201000 /usr/bin/top
Trying to extract information from a core file generated in a different major FreeBSD version might show an error like this โ yeah, that's a whole mood ๐
$ procstat mplayer.core
procstat: kinfo_proc structure size mismatch
procstat: procstat_getprocs()
๐ SEE ALSO
fstat(1), ps(1), sockstat(1), cap_enter(2), cap_rights_limit(2), inotify(2), mlock(2), mlockall(2), libprocstat(3), libxo(3), signal(3), xo_options(7), ddb(4), divert(4), icmp(4), ip(4), sctp(4), tcp(4), udp(4), stack(9)
๐ AUTHORS
- Robert N M Watson
<rwatson@FreeBSD.org>โ the main character who wrote this. libxo(3)support was added by Allan Jude โจallanjude@FreeBSD.orgโฉ.- Juraj Lutter โจjuraj@lutter.skโฉ added the
pargs,penvandpwdxfunctionality. King behaviour fr fr ๐ซถ
๐ BUGS
The display of open file or memory mapping pathnames is implemented using the kernel's name cache. So if a file system doesn't use the name cache, or the path to a file just isn't in the cache โ no path for you, bestie. It simply won't be displayed. ๐
procstat currently supports extracting data only from a live kernel, and not from kernel crash dumps. Noted. No cap.
and that's the whole page, bestie โ you ate that ๐ โจ pop off with your new procstat knowledge, iykyk
This absolute icon of a manpage is from the Debian crew, dated July 16, 2025, and it lives at PROCSTAT(1). Go forth and procstat responsibly ๐ฆ๐
๐ฆ where this page comes from
- freebsd 15.1: base 15.1
- Copyright (c) 2007-2009 Robert N. M. Watson
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms