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
95
votes
12 answers

How to check if ZooKeeper is running or up from command prompt?

I exploring a few options to setup kafka and I knew that the Zookeeper has to be up and running to initiate a kafka. I would like to know how can I find the below. 1) hostname and port for my zookeeper instance---I checked the zoo.cfg and I could…
Suren Baskaran
  • 1,228
  • 1
  • 10
  • 17
85
votes
10 answers

Is there a way to change effective process name in Python?

Can I change effective process name of a Python script? I want to show a different name instead of the real name of the process when I get the system process list. In C I can set strcpy(argv[0],"othername"); But in Python argv[0] =…
Emilio
  • 3,901
  • 11
  • 44
  • 50
73
votes
4 answers

How to get pid given the process name

Hi I have searched various forums and here as well, I could find some answers for Linux and Mac but not able to find solution for Unix and specially Korn Shell. How to get process name (command name) from process id (pid) Below reference I found…
gahlot.jaggs
  • 1,083
  • 3
  • 11
  • 21
68
votes
7 answers

How to examine processes in OS X's Terminal?

I’d like to view information for processes running in OS X. Running ps in the terminal just lists the open Terminal windows. How can I see all processes that are running? Say I’m running a web browser, terminal and text editor. I’d like to see…
SundayMonday
  • 19,147
  • 29
  • 100
  • 154
64
votes
5 answers

Counting open files per process

I'm working on an application that monitors the processes' resources and gives a periodic report in Linux, but I faced a problem in extracting the open files count per process. This takes quite a while if I take all of the files and group them…
Aladdin
  • 1,207
  • 2
  • 16
  • 26
55
votes
4 answers

How to get all process ids without ps command on Linux

How to get all process ids (pid) (similar to: $ ps aux) but without using ps. One example of when this would be used is when developing a dotnet 5 application to run on a docker host. The dotnet runtime image is a very cut-down Linux image, with…
WB Lee
  • 641
  • 1
  • 6
  • 10
54
votes
8 answers

Matplotlib Plots Lose Transparency When Saving as .ps/.eps

I'm having an issue with attempting to save some plots with transparent ellipsoids on them if I attempt to save them with .ps/.eps extensions. Here's the plot saved as a .png: If I choose to save it as a .ps/.eps here is what it looks like: How I…
astromax
  • 6,001
  • 10
  • 36
  • 47
52
votes
2 answers

How to make adb shell ps list all processes in Android O?

adb shell ps not working in O android release adb shell ps command in Android O release is listing only ps process information, but it is not listing all the processes information of all the process like it used to do it in earlier android…
be_good_do_good
  • 4,311
  • 3
  • 28
  • 42
42
votes
3 answers

How to bring an Orphaned Background Process back to Foreground?

Well it goes like this, I had to run a program from my home by sshing into the server in my institution. I did not want my program to be terminated when the session closes(I didn't know about screen). What i did was press Ctrl+Z and then type bg…
Rudra Murthy
  • 710
  • 2
  • 8
  • 20
39
votes
4 answers

Using bash ps and cut together

I need to extract PID, UID and command fields from 'ps' and I have tried it like this: ps -L u n | cut -f 1,2,13 For some reason, this behaves as there is no cut command whatsoever. It just returns normal ps output. Then, I tried ps -L u n | tr -s…
darxsys
  • 1,560
  • 4
  • 20
  • 34
36
votes
2 answers

What does TTY mean in the unix ps command?

When I run PS one of the columns output is TTY. What does this mean? In particular, how does as value of "??" compare with "ttys000"? I ask because I have a Java program execute sort via ProcessBuilder, and when this program is run via my IDE…
Aaron Silverman
  • 22,070
  • 21
  • 83
  • 103
35
votes
3 answers

How to always cut the PID from `ps aux` command?

I'd like to get the pid from my processes. I do ps aux | cut -d ' ' -f 2 but I notice that sometimes it gets the pid and sometimes it does not: [user@ip ~]$ ps aux user 2049 0.5 10.4 6059216 1623520 ? Sl date 8:48 process user 12290 …
makansij
  • 9,303
  • 37
  • 105
  • 183
27
votes
7 answers

Why does ps o/p list the grep process after the pipe?

When I do $ ps -ef | grep cron I get root 1036 1 0 Jul28 ? 00:00:00 cron abc 21025 14334 0 19:15 pts/2 00:00:00 grep --color=auto cron My question is why do I see the second line. From my understanding, ps lists the…
Ankur Agarwal
  • 23,692
  • 41
  • 137
  • 208
26
votes
8 answers

How to change argv0 in bash so command shows up with different name in ps?

In a C program I can write argv[0] and the new name shows up in a ps listing. How can I do this in bash?
bstpierre
  • 30,042
  • 15
  • 70
  • 103
26
votes
5 answers

Find the pid of a java process under Linux

I have a Java program running on a Linux computer, and want to find the process ID (pid) of its process. I know the ps command can provide this information, but its output is confusing because it has so much extraneous information. How can I get…
Shweta B. Patil
  • 1,131
  • 2
  • 11
  • 19
1
2 3
38 39