<commit_before>.\"-
.\" Copyright (c) 1980, 1990, 1991, 1993, 1994
.\"	The Regents of the University of California.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\" 4. Neither the name of the University nor the names of its contributors
.\"    may be used to endorse or promote products derived from this software
.\"    without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\"     @(#)ps.1	8.3 (Berkeley) 4/18/94
.\" $FreeBSD$
.\"
.Dd August 18, 2006
.Dt PS 1
.Os
.Sh NAME
.Nm ps
.Nd process status
.Sh SYNOPSIS
.Nm
.Op Fl aCcefHhjlmrSTuvwXxZ
.Op Fl O Ar fmt | Fl o Ar fmt
.Op Fl G Ar gid Ns Op , Ns Ar gid Ns Ar ...
.Op Fl M Ar core
.Op Fl N Ar system
.Op Fl p Ar pid Ns Op , Ns Ar pid Ns Ar ...
.Op Fl t Ar tty Ns Op , Ns Ar tty Ns Ar ...
.Op Fl U Ar user Ns Op , Ns Ar user Ns Ar ...
.Nm
.Op Fl L
.Sh DESCRIPTION
The
.Nm
utility
displays a header line, followed by lines containing information about
all of your
processes that have controlling terminals.
.Pp
A different set of processes can be selected for display by using any
combination of the
.Fl a , G , p , T , t ,
and
.Fl U
options.
If more than one of these options are given, then
.Nm
will select all processes which are matched by at least one of the
given options.
.Pp
For the processes which have been selected for display,
.Nm
will usually display one line per process.
The
.Fl H
option may result in multiple output lines (one line per thread) for
some processes.
By default all of these output lines are sorted first by controlling
terminal, then by process ID.
The
.Fl m , r , u ,
and
.Fl v
options will change the sort order.
If more than one sorting option was given, then the selected processes
will be sorted by the last sorting option which was specified.
.Pp
For the processes which have been selected for display, the information
to display is selected based on a set of keywords (see the
.Fl L , O ,
and
.Fl o
options).
The default output format includes, for each process, the process' ID,
controlling terminal, CPU time (including both user and system time),
state, and associated command.
.Pp
The process file system (see
.Xr procfs 5 )
should be mounted when
.Nm
is executed, otherwise not all information will be available.
.Pp
The options are as follows:
.Bl -tag -width indent
.It Fl a
Display information about other users' processes as well as your own.
This will skip any processes which do not have a controlling terminal,
unless the
.Fl x
option is also specified.
This can be disabled by setting the
.Va security.bsd.see_other_uids
sysctl to zero.
.It Fl c
Change the
.Dq command
column output to just contain the executable name,
rather than the full command line.
.It Fl C
Change the way the CPU percentage is calculated by using a
.Dq raw
CPU calculation that ignores
.Dq resident
time (this normally has
no effect).
.It Fl e
Display the environment as well.
.It Fl f
Show commandline and environment information about swapped out processes.
This option is honored only if the UID of the user is 0.
.It Fl G
Display information about processes which are running with the specified
real group IDs.
.It Fl H
Show all of the
.Em kernel visible
threads associated with each process.
Depending on the threading package that
is in use, this may show only the process, only the kernel scheduled entities,
or all of the process threads.
.It Fl h
Repeat the information header as often as necessary to guarantee one
header per page of information.
.It Fl j
Print information associated with the following keywords:
.Cm user , pid , ppid , pgid , sid , jobc , state , tt , time ,
and
.Cm command .
.It Fl L
List the set of keywords available for the
.Fl O
and
.Fl o
options.
.It Fl l
Display information associated with the following keywords:
.Cm uid , pid , ppid , cpu , pri , nice , vsz , rss , mwchan , state ,
.Cm tt , time ,
and
.Cm command .
.It Fl M
Extract values associated with the name list from the specified core
instead of the currently running system.
.It Fl m
Sort by memory usage, instead of the combination of controlling
terminal and process ID.
.It Fl N
Extract the name list from the specified system instead of the default,
which is the kernel image the system has booted from.
.It Fl O
Add the information associated with the space or comma separated list
of keywords specified, after the process ID,
in the default information
display.
Keywords may be appended with an equals
.Pq Ql =
sign and a string.
This causes the printed header to use the specified string instead of
the standard header.
.It Fl o
Display information associated with the space or comma separated
list of keywords specified.
The last keyword in the list may be appended with an equals
.Pq Ql =
sign and a string spanning the rest of the argument.
This causes the printed header to use the specified string instead of
the standard header.
Multiple keywords may also be given in the form of more than one
.Fl o
option.
So the header texts for multiple keywords can be changed.
If all keywords have empty header texts, no header line is written.
.It Fl p
Display information about processes which match the specified process IDs.
.It Fl r
Sort by current CPU usage, instead of the combination of controlling
terminal and process ID.
.It Fl S<commit_msg>For the sake of clarity, explicitly tell that comma and space characters can be included in a custom column title string -- that's why it may appear at the end of a keyword list argument only.<commit_after>.\"-
.\" Copyright (c) 1980, 1990, 1991, 1993, 1994
.\"	The Regents of the University of California.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\" 4. Neither the name of the University nor the names of its contributors
.\"    may be used to endorse or promote products derived from this software
.\"    without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\"     @(#)ps.1	8.3 (Berkeley) 4/18/94
.\" $FreeBSD$
.\"
.Dd August 21, 2006
.Dt PS 1
.Os
.Sh NAME
.Nm ps
.Nd process status
.Sh SYNOPSIS
.Nm
.Op Fl aCcefHhjlmrSTuvwXxZ
.Op Fl O Ar fmt | Fl o Ar fmt
.Op Fl G Ar gid Ns Op , Ns Ar gid Ns Ar ...
.Op Fl M Ar core
.Op Fl N Ar system
.Op Fl p Ar pid Ns Op , Ns Ar pid Ns Ar ...
.Op Fl t Ar tty Ns Op , Ns Ar tty Ns Ar ...
.Op Fl U Ar user Ns Op , Ns Ar user Ns Ar ...
.Nm
.Op Fl L
.Sh DESCRIPTION
The
.Nm
utility
displays a header line, followed by lines containing information about
all of your
processes that have controlling terminals.
.Pp
A different set of processes can be selected for display by using any
combination of the
.Fl a , G , p , T , t ,
and
.Fl U
options.
If more than one of these options are given, then
.Nm
will select all processes which are matched by at least one of the
given options.
.Pp
For the processes which have been selected for display,
.Nm
will usually display one line per process.
The
.Fl H
option may result in multiple output lines (one line per thread) for
some processes.
By default all of these output lines are sorted first by controlling
terminal, then by process ID.
The
.Fl m , r , u ,
and
.Fl v
options will change the sort order.
If more than one sorting option was given, then the selected processes
will be sorted by the last sorting option which was specified.
.Pp
For the processes which have been selected for display, the information
to display is selected based on a set of keywords (see the
.Fl L , O ,
and
.Fl o
options).
The default output format includes, for each process, the process' ID,
controlling terminal, CPU time (including both user and system time),
state, and associated command.
.Pp
The process file system (see
.Xr procfs 5 )
should be mounted when
.Nm
is executed, otherwise not all information will be available.
.Pp
The options are as follows:
.Bl -tag -width indent
.It Fl a
Display information about other users' processes as well as your own.
This will skip any processes which do not have a controlling terminal,
unless the
.Fl x
option is also specified.
This can be disabled by setting the
.Va security.bsd.see_other_uids
sysctl to zero.
.It Fl c
Change the
.Dq command
column output to just contain the executable name,
rather than the full command line.
.It Fl C
Change the way the CPU percentage is calculated by using a
.Dq raw
CPU calculation that ignores
.Dq resident
time (this normally has
no effect).
.It Fl e
Display the environment as well.
.It Fl f
Show commandline and environment information about swapped out processes.
This option is honored only if the UID of the user is 0.
.It Fl G
Display information about processes which are running with the specified
real group IDs.
.It Fl H
Show all of the
.Em kernel visible
threads associated with each process.
Depending on the threading package that
is in use, this may show only the process, only the kernel scheduled entities,
or all of the process threads.
.It Fl h
Repeat the information header as often as necessary to guarantee one
header per page of information.
.It Fl j
Print information associated with the following keywords:
.Cm user , pid , ppid , pgid , sid , jobc , state , tt , time ,
and
.Cm command .
.It Fl L
List the set of keywords available for the
.Fl O
and
.Fl o
options.
.It Fl l
Display information associated with the following keywords:
.Cm uid , pid , ppid , cpu , pri , nice , vsz , rss , mwchan , state ,
.Cm tt , time ,
and
.Cm command .
.It Fl M
Extract values associated with the name list from the specified core
instead of the currently running system.
.It Fl m
Sort by memory usage, instead of the combination of controlling
terminal and process ID.
.It Fl N
Extract the name list from the specified system instead of the default,
which is the kernel image the system has booted from.
.It Fl O
Add the information associated with the space or comma separated list
of keywords specified, after the process ID,
in the default information
display.
Keywords may be appended with an equals
.Pq Ql =
sign and a string.
This causes the printed header to use the specified string instead of
the standard header.
.It Fl o
Display information associated with the space or comma separated
list of keywords specified.
The last keyword in the list may be appended with an equals
.Pq Ql =
sign and a string that spans the rest of the argument and can contain
space and comma characters.
This causes the printed header to use the specified string instead of
the standard header.
Multiple keywords may also be given in the form of more than one
.Fl o
option.
So the header texts for multiple keywords can be changed.
If all keywords have empty header texts, no header line is written.
.It Fl p
Display information about processes which match the specified process IDs.
.It Fl r
Sort by current CPU usage, instead of the combination of controlling
terminal and process ID.
.It Fl S
{'fraction_non_alphanumeric': 0.055169811320754714, 'fraction_numerical': 0.0060377358490566035, 'mean_word_length': 3.6642027455121435, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3158931', 'n_tokens_mistral': 3746, 'n_tokens_neox': 3464, 'n_words': 2233}