PSTAT(8)
π PSTAT(8) π β display system data structures
okay bestie, welcome to pstat (and its little sibling swapinfo), the manual page you didn't know you needed. this is system data structure central, and honestly? it's giving backstage pass to the kernel. π
β¨ NAME β¨
pstat, swapinfo β display system data structures π
πΈ SYNOPSIS πΈ
pstat [-Tfghkmnst] [-M core [-N system]]
swapinfo [-ghkm] [-M core [-N system]]
π¦ DESCRIPTION π¦
so basically, the pstat utility displays open file entry, swap space utilization, terminal state, and vnode data structures. it's a whole little tour of what your system is up to. literally the gossip column of data structures. no cap.
if you invoke it as swapinfo, the -s option is implied, and only the -k, -m, -g, and -h options are legal. that's the rule, bestie, don't fight it.
if the -M option is not specified, information is obtained from the currently running kernel via the sysctl(3) interface. otherwise, information is read from the specified core file, using the name list from the specified kernel image (or from the default image). iykyk. π«
the following options are available:
π OPTIONS π
-nβ print devices out by major/minor instead of name. numbers > names, sometimes.-hβ βHuman-readableβ output. use unit suffixes when printing swap partition sizes: Byte, Kilobyte, Megabyte, Gigabyte, Terabyte and Petabyte. so your brain doesn't have to do math at 2am π§ β¨-kβ print sizes in kilobytes, regardless of the setting of theBLOCKSIZEenvironment variable. we simply do not care whatBLOCKSIZEthinks.-mβ print sizes in megabytes, regardless of the setting of theBLOCKSIZEenvironment variable. again:BLOCKSIZE, stay in your lane.-gβ print sizes in gigabytes, regardless of the setting of theBLOCKSIZEenvironment variable. big numbers for big vibes.-Tβ print the number of used and free slots in several system tables. this is useful for checking to see how large system tables have become if the system is under heavy load. very much a "how full is the club" situation, and the club is your kernel. π₯-fβ print the open file table with these headings:LOCβ the core location of this table entry.TYPEβ the type of object the file table entry points to.FLGβ miscellaneous state variables encoded thus:Rβ open for readingWβ open for writingAβ open for appendingIβ signal pgrp when data ready
CNTβ number of processes that know this open file.MSGβ number of messages outstanding for this file.DATAβ the location of the vnode table entry or socket structure for this file.OFFSETβ the file offset (seelseek(2)).
okay the legend alone is a whole personality test honestly. π
-sβ print information about swap space usage on all the swap areas compiled into the kernel. the first column is the device name of the partition. the next column is the total space available in the partition. theUsedcolumn indicates the total blocks used so far; theAvailablecolumn indicates how much space is remaining on each partition. theCapacityreports the percentage of space used.
if more than one partition is configured into the system, totals for all of the statistics will be reported in the final line of the report. the grand finale, if you will. π
-tβ print table for terminals with these headings:LINEβ device name.INQβ number of characters that can be stored in the input queue.CANβ number of characters in the input queue which can be read.LINβ number of characters in the input queue which cannot be read yet.LOWβ low water mark for input.OUTQβ number of characters that can be stored in the output queue.USEβ number of bytes in the output queue.LOWβ low water mark for output.COLβ calculated column position of terminal.SESSβ process ID of the session leader.PGIDβ process group for which this is the controlling terminal.STATEβ miscellaneous state variables encoded thus:Iβ init/lock-state device nodes presentCβ callout device nodes presentOβ openedcβ console in useGβ goneBβ busy inopen(2)Yβ sendSIGIOfor input eventsLβ next character is literalHβ high watermark reachedXβ open for exclusive useSβ output stopped (ixon flow control)lβ block mode input routine in useZβ connection lostsβ i/o being snoopedbβ busy inread(2)orwrite(2)
the βiβ and βoβ characters refer to the previous character, to differentiate between input and output. tiny detail, huge importance, we love a clarifying note. π«Ά
also yes, LOW shows up twice on purpose β once for input, once for output. not a typo, bestie, it's just living its double-life truth. π
-Mβ extract values associated with the name list from the specified core.-Nβ if-Mis also specified, extract the name list from the specified system instead of the default, which is the kernel image the system has booted from.
π ENVIRONMENT π
BLOCKSIZEβ if the environment variableBLOCKSIZEis set, and the-h,-k, or-moptions are not specified, the block counts will be displayed in units of that block size. ifBLOCKSIZEis not set, and the-h,-k, or-moptions are not specified, the block counts will be displayed in 512-byte blocks. so it's either your vibe or the classic 512. π
β SEE ALSO β
ps(1), systat(1), stat(2), fs(5), iostat(8), vmstat(8)
K. Thompson, UNIX Implementation.
the reading list is stacked, ngl. π
π§ HISTORY π§
the pstat utility appeared in 4.0BSD. an icon, a legend, a moment in time. β¨
π BUGS π
does not understand NFS swap servers. that's it, that's the whole bug. it simply refuses to comprehend them. π
okay that's the whole page, bestie β go forth and inspect those structures. this was the Debian edition, dated July 8, 2022, and honestly? iconic of it. mwah. πππ¦
π¦ where this page comes from
- freebsd 15.1: base 15.1
- Copyright (c) 1980, 1991, 1993, 1994 The Regents of the University of California. All rights reserved
- Copyright (c) 2002 Networks Associates Technology, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms