Questions tagged [ps]

ps is the UNIX command for retreiving process information.

From the Linux User's Manual:

DESCRIPTION
   ps displays information about a selection of the active processes.

By default, ps displays the current processes owned by the user executing the command and attached to the same process group as the shell that launches it. On most UNIX systems, the command
ps -A (or ps -e) will display information about all processes running on the system.

See also:
[unix] tag info
[process] tag info
[fork] tag info


  • For questions about the Postscript language, please use the tag instead.
  • For questions about the windows power shell, please use the tag instead.
585 questions
5
votes
1 answer

Why does "htop" show me dozens of PIDs in use by my app, but "ps" only shows me one?

I have a Clojure app that I am developing. I am testing it on the server, mostly by going into a "screen" session and typing: java -jar lo_login_service-0.2-standalone.jar and then I kill it by hitting Control-C. Then I make some changes. Then I…
cerhovice
  • 676
  • 1
  • 10
  • 24
5
votes
1 answer

Follow pids across machines (ssh)

I am basically trying to write a pstree-like command except that it should follow processes across machines. What I mean is that if I run this : $ ssh $node sleep 1000 Then the command should display something like this : ssh $node -- ($node) sleep…
user268744
  • 371
  • 1
  • 8
5
votes
1 answer

Getting the (parent) process executing the command in Linux shell

Please advice , how to verify the program that execute the process ? For example the following commands ( ps -ef ) will view the process sendmail in case this process is running ps –ef | grep sendmail root 9558 9544 019:05? …
user1121951
5
votes
1 answer

Meaning of columns from ps

In Linux bash, what do the four columns mean from ps? e.g PID TTY TIME CMD 15286 pts/498 00:00:00 bash 30887 pts/498 00:00:00 ps
joe
  • 385
  • 6
  • 9
  • 17
4
votes
4 answers

Group processes with ps

I want to use ps on my desktop through geektools to see what processes are using what. Currently my command is: ps -amcwwwxo "command %mem %cpu" | grep -v grep | head -13 The problem with this, is seeing as I'm using chrome, the process "Google…
skeletalmonkey
  • 726
  • 1
  • 10
  • 20
4
votes
0 answers

Looking for an explanation about containerd-shim/runc child processes

We are using docker within a swarm environnement. Everything is fine... but for a strange process named "exe" that appeared, a few days ago : 14126 root 20 0 446836 33648 184 R 49.0 0.2 0:05.98 exe 1 root 20 0 52356 …
Marvin
  • 1,650
  • 4
  • 19
  • 41
4
votes
0 answers

What's memory shown in docker stats really mean?

1) I use next to start a container: docker run --name test -idt python:3 python -m http.server 2) Then, I try to validate memory usage like next: a) root@shubuntu1:~# ps aux | grep "python -m http.server" root 17416 3.0 0.2 27368 19876 pts/0…
atline
  • 28,355
  • 16
  • 77
  • 113
4
votes
1 answer

Bash - Two processes for one script

I have a shell script, named test.sh : #!/bin/bash echo "start" ps xc | grep test.sh | grep -v grep | wc -l vartest=`ps xc | grep test.sh | grep -v grep | wc -l ` echo $vartest echo "end" The output result is : start 1 2 end So my question is,…
user6050469
  • 177
  • 11
4
votes
1 answer

subprocess pid different from ps output

Why is it that the subprocess pid (Popen.pid) has different value from that the ps command returns? I've noticed this when ps called both from inside python (with subprocess.call()) and from another terminal. Here's a simple python file to…
Matthew
  • 393
  • 4
  • 9
4
votes
4 answers

Bash script counting instances of itself wrongly

I've created a bash script which counts launched instances of itself. Here it is (in this example, I'm showing the instances rather than counting them with wc -l) : #!/bin/bash nb=`ps -aux | grep count_itself.sh` echo "$nb" sleep 20 (Of course, my…
roberto06
  • 3,844
  • 1
  • 18
  • 29
4
votes
2 answers

How to get a process tree trace/log of a process in linux?

I want to know what executables a script launches and in what order (and trace those executables recursively). For example, let's say I have a bash script here (called abc.sh): #!/bin/bash ls gcc I'd like to run this script with a "trace/log…
madiyaan damha
  • 2,917
  • 5
  • 21
  • 15
4
votes
1 answer

re-parenting stopped process

How does re-parenting of stopped process heppens? Why does stopped process just terminates after re-parenting? More precisely, suppose I have a code like this #include #include #include #include
PepeHands
  • 1,368
  • 5
  • 20
  • 36
4
votes
2 answers

What does lowercase t means in ps state code

When I run ps xaf I have a following output: So my application has state code t+. But I can't find what it means. In man ps where is no such state code: Does it equal to uppercase T state code? If it is, why do I always only get T state code when…
PepeHands
  • 1,368
  • 5
  • 20
  • 36
4
votes
4 answers

Is there any way to get ps output programmatically?

I've got a webserver that I'm presently benchmarking for CPU usage. What I'm doing is essentially running one process to slam the server with requests, then running the following bash script to determine the CPU usage: #! /bin/bash for (( ;;…
Jason Baker
  • 192,085
  • 135
  • 376
  • 510
4
votes
1 answer

ps column width truncated in FreeBSD

ps aux | grep mongo in zsh, for example, outputs /usr/local/bin/mongod --logpath /var/db/mongodb/mongod.log --logappend --config /usr/local/etc/mongodb.conf --dbpath /var/db/mong You can see that it runs off the screen and gets cutoff at the end. In…
mareoraft
  • 3,474
  • 4
  • 26
  • 62