Questions tagged [ps]

For questions pertaining to ps, a command for printing information about running processes. Use this tag for questions about ps itself or questions about issues arising from using the ps command-line utility.

According to the ps(1) man page

ps (short for "process status") displays a selection of the active processes, subject to having appropriate privileges to obtain information about those processes. If you want a repetitive update of the selection and the displayed information, use instead.

Further reading

How can I prevent 'grep' from showing up in ps results?

Why does `htop` show more process than `ps`

What does aux mean in `ps aux`?

External References

ps specification (The Open Group Base Specifications Issue 7, 2018 edition)

ps article in Wikipedia

648 questions
25
votes
1 answer

What does `I` (uppercase i) mean in `ps aux`?

In man page of ps under Process State Codes, the I flag (capital i) is not mentioned but ps aux shows the I flag in some processes as shown by the image below. What does the I flag mean?
13
votes
10 answers

How to find the PID of nginx process

I am trying to fix a problem with nginx and think that there is an nginx process running on my machine. When I run this command I get this output. $ ps aux -P | grep nginx 1000 3947 0.0 0.0 13596 932 pts/0 S+ 14:05 0:00 grep…
bernie2436
  • 6,655
7
votes
2 answers

How do I tell `ps` to use all available columns?

To specify columns, I can use ps's -o option: ps -o pid,cmd How can I tell ps to output all of its available columns?
Flimm
  • 4,218
7
votes
3 answers

Why does ps aux | grep return extra hit

Let's say I want to know the PID of kate editor that is currently running (kate is just an example, it works as described for many programs). So, I execute ps aux | grep kate. Here is the output: seifert 35523 0.0 0.2 448724 25144 ? Sl …
S. N.
  • 287
7
votes
1 answer

pgrep only current user

I was wondering what the arguments were for pgrep to make it act only on the current user. -u makes me provide names, I don't know the name of the current user, I just know that I need current user only. Thanks
Noitidart
  • 307
  • 3
  • 8
7
votes
2 answers

how to print ps header when using pipe in linux

how to print ps header when using pipe in linux this normal ps output $ ps -ef UID PID PPID C STIME TTY TIME CMD root 1 0 0 17:00 ? 00:00:02 /usr/lib/systemd/systemd but below ps command output without…
public_name
  • 71
  • 2
  • 2
  • 4
6
votes
2 answers

ps: format (separator and width)

I'd like to specify the column-separator ps -o "%a|%p" # separator | and the column-width ps -o cmd:50,pid # width 50 for cmd in one command. Is this possible?? It is not about the column-width but I'd like to have the full length…
chris01
  • 571
4
votes
1 answer

What is the difference between "ps -eu" and "ps -u"?

I check the manual of ps, and it said -e will list all processes, while -u will list processes for a specific user. So I try to use ps -eu myaccount | wc -l and it outputs 280. But if I use ps -u myaccount | wc -l and it outputs 12. Since both are…
alancc
  • 213
4
votes
1 answer

How can I use `--lines` `--row` modifiers in `ps` command

I often used the following command, ps -eo pid,cmd,pcpu,pmem --sort=-pcpu | head But in the man page I saw the following to output modifiers, --lines n Set screen height. --rows n Set screen height. As if these modifiers…
arif
  • 1,459
4
votes
1 answer

What is the meaning of "1-" in the output of ps?

This is the output of the command ps -ef | grep java on one of our machines. jboss 1965 1935 1 2013 ? 04:41:05 java XXXXXXXXXXXXXXXXX jboss 2170 2141 0 2013 ? 00:42:57 java XXXXXXXXXXXXXXXXX jboss 2708 2679 7 …
Rich
  • 4,529
3
votes
2 answers

How can I automate this manual task of finding a particular ancestor process from a given pid or command?

I know the full command "/bin/child_process" or its pid (3996 in this case) and I'm running ps auxf and then visually identifying its ancestor process /bin/parent_process foobar. root 3227 0.0 0.0 992 296 ? S
3
votes
1 answer

Why does `ps e` show more processes than `ps`?

From the ps man page: By default, ps selects all processes with the same effective user ID (euid=EUID) as the current user and associated with the same terminal as the invoker. On my Ubuntu system, ps without any flags gives the output below,…
samshers
  • 678
3
votes
1 answer

-p and -o comm doesn't work together?

I'm trying to get CPU usage of a process by, ps -p 12990 -o comm=comm,pcpu But that only print the command name (the process does exist), what's wrong with it?
daisy
  • 54,555
3
votes
1 answer

ps - filter by user and processes without terminals

I've been scrounging around the man page trying to understand ps better. Is there a combination of flags that causes ps to return all of the processes for my user that aren't attached to a terminal? The -t - and -u steve filters seem to combine as…
xdhmoore
  • 145
3
votes
2 answers

How to determine which script is being executed by bash?

How would I determine which script is being executed by a process? When I use: ps -u user I get the following output: 10005194 26932 0.0 0.0 112700 1544 ? Ss Jun03 0:00 -bash 10005194 27117 0.0 0.0 112700 1528 ? Ss Apr24 …
1
2 3 4