I'm starting to learn shell, and I have a question about the command ps -e
does this command show all the processes that exist that are running and not running on the machine, or only those who are already running?

- 333,661

- 1
- 1
- 1
-
By "isn't running", what do you actually mean? A process is always "running", but it may well be in a state where it's waiting etc. – Kusalananda Nov 22 '20 at 18:56
3 Answers
There is (almost) no such thing as a “process that is not running”. A process is something that is running, by definition. You may be confusing processes, which are running programs, with executable files, also called programs, which exist in storage. ps
shows processes and doesn't care about programs (except when it lists the executable file associated with the process in the CMD
or COMMAND` column).
(The “almost” is because zombie processes might be considered processes that have stopped running. They're processes whose parent hasn't yet noticed that they're dead. But for most purposes it's more useful to think of zombie processes as entries in the process table that don't represent a process anymore.)

- 829,060
This will show not only your own processes, but all the other processes running under different users as well
For more details visit this reference : https://www.unixtutorial.org/commands/ps

- 307
The manual page for any command has a wealth of information on usage. Per the man page for ps:
DESCRIPTION ps displays information about a selection of the active processes. If you want a repetitive update of the selection and the displayed information, use top(1) instead.
The command ps -e shows every active process on the system regardless of user. There are several optional arguments that you can add to ps in order to change what information displayed; for example:
$ ps --user student
would only show active processes for the user named student.