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
4
votes
2 answers

How to make Python apscheduler run in background

I want to make Python apscheduler run in background , here is my code: from apscheduler.schedulers.background import BackgroundScheduler, BlockingScheduler from datetime import datetime import logging import…
lqhcpsgbl
  • 3,694
  • 3
  • 21
  • 30
4
votes
3 answers

Sort PS command by etime

So I am trying to develop a script that will find specfic processes, and kill the one that has been running the longest. Trying to get the command sorted by elapsed time is becoming the issue. Here is the command i am running, i know there are…
Deldran
  • 153
  • 1
  • 3
  • 9
4
votes
4 answers

Getting memory usage from 'ps aux' output with awk

I have to solve an exercise using awk. Basically I need to retrieve from 'ps aux' command the total of memory usage for each user and format like this: User Total%Mem user1 3.4% user2 1.5% and so on. The problem I can't seem to solve…
Jubstuff
  • 2,541
  • 3
  • 22
  • 24
4
votes
1 answer

How portable is the `ps` command?

I'm making a bash script and I'd like to make sure it's portable. For context, the command will be the part of tmux-resurrect plugin. I want to use this command: ps -eo ppid,command. Is that command portable? I'd also be glad to hear how to check…
user777337
4
votes
1 answer

how to find path from where current binary running?

After somewhere searching finally not getting what i want. I am working on some embedded board with linux system. And many users access it by telnet.So each user suppose copy some binary somewhere and executed like ./binary.So i can see this process…
Jayesh Bhoi
  • 24,694
  • 15
  • 58
  • 73
4
votes
3 answers

Defunct processes using CPU

The output of ps aux contains the following: USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND ubuntu 1496 9.1 0.0 0 0 pts/0 Z+ 19:47 0:30 [python] ubuntu 1501 14.6 0.0 0 0 pts/0 …
Zags
  • 37,389
  • 14
  • 105
  • 140
4
votes
1 answer

Using 'ps' command in Linux, how to see the realtime data?

I found that my java web server(tomcat) used high cpu, so I used 'ps aux' to see the process infomation, like: # ps aux | grep -E "PID|java" USER PID %CPU %MEM root 7533 143 39.8 It showed that java took 143% cpu. Then I used…
lonelycoder
  • 73
  • 1
  • 1
  • 9
4
votes
2 answers

How can I determine the number of threads Matlab is using?

When I run simply "matlab", maxNumCompThreads returns 4. When I run "matlab -singleCompThread", maxNumCompThreads returns 1. However in both instances, ps uH p | wc -l (which I picked up from another question on SO to determine the number of…
CptSupermrkt
  • 6,844
  • 12
  • 56
  • 87
4
votes
1 answer

How does ps aux | grep '[p]attern' exclude grep itself?

The title says it all. I've seen this idiom used alot instead of adding an additional grep -v grep in some ps pipeline. For example it could be used like this: $ ps aux | grep '[f]irefox' | awk '{ print $8 }' instead of $ ps aux | grep 'firefox' |…
user1019830
4
votes
3 answers

Bash generic "ps aux" process by strict name

I'm trying to have a ps aux command listing only real ssh-agent process. I've noticed that on some distros, I have unwanted process showing up, like command colors and such. I need to do this because I need to ensure the real ssh-agent process is…
trox
  • 306
  • 4
  • 12
3
votes
2 answers

displaying original args after localizing $0

When run with arguments a b c d e f g, this script: system("ps ww$$"); { local $0 = "foo"; system("ps ww$$"); } system("ps ww$$"); prints something like: PID TTY STAT TIME COMMAND 16057 pts/5 S+ 0:00 perl /tmp/u a b c d e f g …
ErikR
  • 51,541
  • 9
  • 73
  • 124
3
votes
1 answer

What it means that + in the c++ process state

I make the test.cpp and compile this. int main() { while(1); } g++ test.cpp And ps -aux | grep a.out. The process state a.out is R+. Yes. Of course, the process infinitely runs. But, I don't understand the + In ps manual, + is in the foreground…
3088 K
  • 75
  • 5
3
votes
1 answer

what does -w specifies in perl script process execution

When I was checking processes of perl using ps aux | grep perl the list of perl pid's got listed where its waiting in queue. so i started investigating how this processes got initiated /usr/local/bin/processLogs. I wanted to know what does -w meant…
AK90
  • 428
  • 1
  • 4
  • 16
3
votes
6 answers

Kill a process from Linux Application

What is best and most efficient way to find pid of a specific task. Say: ps -ef | grep "\/usr\/sbin\/watchdog" | cut -d" " -f2 Is there any more efficient way to find the same. I want to kill the watchdog process from my application. I am thinking…
Karun
  • 447
  • 5
  • 17
3
votes
1 answer

rtprio and pri values range in Linux ps

I generate a normal process and check with cmd: ps -p [PID] -o uname, cmd, cls, pri, rtprio and have result USER CMD CLS PRI RTPRIO haivo ./pro1 TS 17 - as far as I know Linux just know priority from 0 - 139 and priority from 0-99…
Hai
  • 73
  • 1
  • 10