@msw did a good job explaining your 2nd Q, and some of your 1st:
B) Suggest any relatively-easy ways to regain any form of control, to (at the very least) save the tabs I had annoyingly opened in Private Browsing mode?
So I'll try and address your 1st Q a bit more:
A) Elaborate as to what the state is, in more detail?
The state values Sl
(That's a lowercase L):
S Interruptible sleep (waiting for an event to complete)
l is multi-threaded (using CLONE_THREAD, like NPTL pthreads do)
PROCESS STATE CODES
R running or runnable (on run queue)
D uninterruptible sleep (usually IO)
S interruptible sleep (waiting for an event to complete)
Z defunct/zombie, terminated but not reaped by its parent
T stopped, either by a job control signal or because
it is being traced
[...]
Further details can be seen in the signal man page, man 7 signal
, as well as in this tutorial, titled: Linux process states.
Both the comm
column and the first word of the args
column in the ps
output show the name of the executable program if everybody involved follows the default convention. However it is possible to have discrepancies for various reasons.
When a program starts, the command name as shown in the args
column is chosen by the parent program that executes the program and passed as an argument (argv[0]
). By convention, the parent chooses the base name of the executable (i.e. the path to the executable without the directory part), but this is not enforced. Once the program is running, it can overwrite that string.
Init (at least the traditional Linux SysVinit) overwrites its argv[0]
to indicate the current runlevel.
On Linux, the comm
column is initially filled in by the kernel to the first 16 characters of the base name of the executable. The process can change the content with the prctl
system call.
If the executable is renamed or deleted, neither the comm
column nor the args
column will reflect this.
ps
doesn't display the path to the executable, that's not in its job description. lsof
can tell you with lsof -a -p 1 -d txt
.
On Linux, you can see this information in files in /proc/PID/
:
- The process name (
comm
field) in in /proc/1/stat
(second field in parentheses) and /proc/1/status
(Name
field).
- The path to the executable via
/proc/1/exe
.
- The arguments (starting with
argv[0]
) in /proc/1/cmdline
(the arguments are separated by null bytes).
Best Answer
a = show processes for all users
u = display the process's user/owner
x = also show processes not attached to a terminal
By the way,
man ps
is a good resource.Historically, BSD and AT&T developed incompatible versions of
ps
. The options without a leading dash (as per the question) are the BSD style while those with a leading dash are AT&T Unix style. On top of this, Linux developed a version which supports both styles and then adds to it a third style with options that begin with double dashes.All (or nearly all) non-embedded Linux distributions use a variant of the procps suite. The above options are as defined in the procps
ps
man page.In the comments, you say you are using Apple MacOS (OSX, I presume). The OSX man page for
ps
is here and it shows support only for AT&T style.