Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
The results are in! See what nearly 90,000 developers picked as their most loved, dreaded, and desired coding languages and more in the 2019 Developer Survey.

Questions tagged [ps]

ps is a command for printing information about running processes

2
votes
1answer
30 views

Error using ps2pdf

I used to work on linux in a virtual Box and now I'm using a computer with Ubuntu 16.04. I have some ps files I need to convert to pdf and I used to run the command ps2pdf file.ps file.pdf in my ...
-5
votes
0answers
56 views

What are the effective differences between `-p` and `-q` for `ps`? [duplicate]

man ps says -p pidlist Select by PID. This selects the processes whose process ID numbers appear in pidlist. Identical to p and --pid. -q pidlist Select by PID (quick ...
0
votes
1answer
35 views

How can I list information about a thread/LWP by `ps`?

How can I list information about a thread/LWP by ps? Why can't I do that simply by: $ ps 10173 PID TTY STAT TIME COMMAND $ ps -L 10173 PID LWP TTY STAT TIME COMMAND The best I ...
4
votes
2answers
283 views

sleep command using screen command is not displayed in ps

I'm running the sleep command in terminal using screen and in detached mode. Once the screen immediately returns, I'm running ps command to verify the sleep is running. $ screen -d -m 'sleep 2m' [raj@...
1
vote
2answers
46 views

ps --sort: List process active for more than 24 hours

The command ps -ef | grep frmweb gives a huge list for me, which I want to filter: weblogic 687 80703 0 08:58 ? 00:00:03 /opt/weblogic/product/fmw/bin/frmweb webfile=HTTP-0, weblogic 2129 ...
0
votes
0answers
14 views

What ps WCHAN sync_b means?

I have this ps output: F S UID PID PPID C PRI NI ADDR SZ WCHAN STIME TTY TIME CMD 0 D root 30394 30390 0 80 0 - 25731 sync_b Apr07 ? 00:12:22 du -sh /poze/output ...
0
votes
2answers
47 views

How do ` -f` and `-o` interact in `ps`?

How do -f and -o interact in ps? They shouldn't work together, according to ps: output modifiers vs output format control and https://unix.stackexchange.com/a/446198/674, since -f implicitly ...
-5
votes
2answers
46 views

What processes do `ps f` show?

by ps from procps-ng $ ps f | wc -l 225 $ ps -e | wc -l 410 $ ps | wc -l 4 ps -e shows all the processes and ps only those with current terminal as controlling terminal. What processes do ps f show? ...
0
votes
1answer
20 views

How can I view threads for a running process that is creating threads?

I made a very small program that creates two threads: #include <pthread.h> #include <stdio.h> #include <unistd.h> void *start() { printf("Am a new thread!\n"); ...
0
votes
0answers
53 views

Linux ps command show a wrong time

When I use ps axo pid,lstart,command it returns the wrong time for eg.: 27936 Tue Oct 15 13:45:51 2019 This is a future time. System clock seems fine. Do you have any suggestions to search for the ...
1
vote
1answer
36 views

AIX 7.2 Topas show high CPU

When I execute topas for a certain process, in the CPU% column it shows me 43% and jumping to 85%. When I execute: "ps aux | grep processName" The same process is at 5%. What is more accurate? I ...
0
votes
2answers
54 views

How to find process by exact command?

This is the list of my processes: $ ps PID USER TIME COMMAND 1 root 0:00 bash -c cp -R /docker /var/lib; echo Loading...; wrapdocker 7 root 0:00 bash --login 312 root ...
0
votes
1answer
37 views

What is the meaning of the R/D flag in ps output?

What is the meaning of R / D from ps ax? Does it indicate a problem? 3 ? R 522:45 [ksoftirqd/0] 4380 ? Rl 1240:31 gdm-session-worker [pam/gdm-launch-environment] 5938 ? ...
0
votes
1answer
30 views

awk + how to capture the third field on both characters

from ps ax we get the following output ps ax PID TTY STAT TIME COMMAND 1 ? Rs 611:56 /usr/lib/systemd/systemd --switched-root --system --deserialize 21 2 ? S ...
2
votes
1answer
35 views

Red Hat Linux - port is in listening state but could not find process ID

I have this problem for my application, port is in listening state but process ID is not showing up. Used below commands. This is cloud AWS server Red Hat Linux. $ netstat -tulpn tcp 0 ...
1
vote
2answers
86 views

How convert bash output to JSON with key {#PROCNAME}?

I try get JSON with top 5 process by memory. This JSON i want send to Zabbix and draw top 5 process by memory. I get top 5 process by memory by command: ps axho comm --sort -rss | head -5 node ...
0
votes
0answers
36 views

How to store output(data) in csv format? [duplicate]

I am making process monitoring application. Now my need is To get process related data(pid, process name, cpu usage, memory usage and virtual memory usage). After completing first step I want to ...
2
votes
1answer
87 views

PID full path to executable in macOS Mojave

ps axww -o command This command gives me the "command" used to run the process. It also includes the "path" to the executable. I need ONLY the path. The problem is it also includes arguments with the ...
-1
votes
2answers
394 views

Why does the command ps not display the entire list of processes?

If the command ps awx | grep -v grep is run the following output is produced. The list below is the last 20 lines of the complete output. 4247 pts/1 Ss+ 0:00 /bin/bash 4442 ? S< ...
0
votes
1answer
29 views

File manager instances not showing among running processes

I've over 10 windows of a file manager (Thunar, on Xubuntu Core 18.04) open, but ps aux|grep thunar shows nothing (except for the grepped string). Why? ps -e doesn't not show anything either. EDIT: ...
0
votes
1answer
50 views

Process appear by “netstat” but doesn't appear by “ps -a”

I have a machine in my organization that I sshed and received a terminal. When I run netstat -ntlp I received: [root@webtl1 ~]# netstat -ntlp Active Internet connections (only servers) Proto ...
0
votes
1answer
91 views

is it possible to avoid open files? [closed]

when we run lsof to capture deleted files , we see the following: ( example ) lsof +L1 java 193699 yarn 1760r REG 8,16 719 0 93696130 /grid/sdb/hadoop/hdfs/data/current/PLP-...
2
votes
1answer
67 views

How to kill and rerun process in one command in Linux

Usually, I use the ps command on Linux to find the pid of the process, then I kill the process using this pid and after that I rerun the process with some specific command for this specific process. ...
2
votes
1answer
113 views

why sometime need to stop process by kill -9

we have kafka machines in hadoop cluster the script that stop the kafka process do the following kill PID but we notice that the script that stop the kafka not really kill the process therefore we ...
0
votes
3answers
199 views

Why does the following two commands of ps give different `CMD` field?

Why does the following two commands of ps give different CMD field? It matters because screen and SCREEN are different: the first is client and the second is server. Thanks. $ ps -A | grep -i screen ...
-2
votes
1answer
76 views

What counts into the cumulative CPU time for a bash process?

What counts into the cumulative CPU time for a bash process? Only when bash is parsing all kinds of commands before actually executing them, and when bash is running builtin command and function ...
2
votes
1answer
188 views

Are tid and tgid always the same as pid in the output of ps?

In manpage of ps tid TID the unique number representing a dispatchable entity (alias lwp, spid). This value may also appear as: a ...
0
votes
0answers
43 views

What is the “login session” of a process? [duplicate]

In the manpage of ps lsession SESSION displays login session identifier of a process. What does the "login session" of a process mean? ps has other fields cgname and cgroup for the cgroup ...
0
votes
0answers
34 views

Use 'ssh ps aux' to gurantee process alive, mistake sometime

Q1 : Recently, some operations scripts is deployed on machine-01, in order to monitor process alive in remote machines. This feature is done by periodly do following cmd: ssh $ip "ps aux | grep $...
2
votes
1answer
740 views

ps is not showing all processes

I used the script command immediately after I started the terminal, it started recording my current session but when i used ps command after that it is showing only two processes, one for bash and one ...
4
votes
1answer
205 views

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 ...
-1
votes
1answer
39 views

Only USERID, PID, TIME, and COMMAND for specific user Shell Script

I have to get Only USERID, PID, TIME, and COMMAND for a specific user. I have tried ps -u user1 But that display PID TTY TIME CMD, but I dont want the Field TTY.
0
votes
2answers
132 views

What exactly does `ps -p PID` do that `ps -q PID` does not?

According to man ps: -p pidlist Select by PID. This selects the processes whose process ID numbers appear in pidlist. Identical to p and --pid. -q pidlist ...
0
votes
3answers
112 views

How can I parse the output of `ps` to different fields?

I would like to parse the output of ps, to get any field using awk. It seems that ps separate the fields by whitespaces, but the values in COMMAND field usually have whitespaces. Is there a way to ...
0
votes
1answer
57 views

How can I logically AND two selection conditions in ps?

I am simulating the default behavior of ps without arguments: One selection condition is to find processes with controlling terminal being the same as the one of the current shell. The other ...
0
votes
2answers
33 views

How can I find out the Screen server process?

Does GNU Screen have a server-client architecture model? Is each Screen session a Screen client process? Why can't I find out the Screen server process, but only its session processes i.e. ...
0
votes
0answers
31 views

How to list all NEW running processes? [duplicate]

How to do something like akin to "tail -f" on ps ? In other words I would like to see the list of newly created processes, as they get created. I don't think top/htop can to that. Bonus if it shows ...
3
votes
1answer
206 views

The `PRI` column of `ps` is inconsistent with man pages

I've been trying to understand how scheduling priorities work in linux. Here's what I've got: The kernel uses a priority value for each process which ranges from 0 to 139. The lower the number, the ...
0
votes
1answer
141 views

find process 0 in ps tree

I read the following sentence from an instruction Process ID 0 is usually the scheduler process and is often known as the swapper. No program on disk corresponds to this process, which is part of ...
3
votes
4answers
319 views

Get list of processes that were forked off my currently running process?

I am writing a wrapper application to bash scripts and want the application to keep a track of which tools/processes have been launched from user scripts. I would like to know what is the best way to ...
1
vote
1answer
41 views

Process state characterization in output of ps command

The ps command shows the state of the process (e.g. Sleeping, Running etc) as also some additional info about. Among two of these additional options according to the man page are < high-...
0
votes
1answer
245 views

Intepretation of -x and -a flags in ps command

According to the man page of ps command, the x flag Lift the BSD-style "must have a tty" restriction, which is imposed upon the set of all processes when some BSD-style ...
4
votes
1answer
105 views

Determine all processes running by root with 2 columns showing: pid,cmd

What I did: ps -ax -o pid,cmd,user | grep root but this shows me on 3 columns showing the root inclusive, how do I eliminate the "root" column?
0
votes
1answer
28 views

00001 root /sbin/launchd

When check the pstree $ pstree -g 2 -p $$ | sed "s/$USER/me/g" ─┬◆ 00001 root /sbin/launchd └─┬◆ 00277 me /Applications/Utilities/Terminal.app/Contents/MacOS/Terminal -psn_0_40970 └─┬◆ 00360 root ...
1
vote
1answer
51 views

Unable to see agetty ttyS0 in process list when connected with serial console

I am using ttyS0 as a serial console to connect to a redhat linux, which is setup using /etc/init/ttyS0.conf. When I am connected to serial console, could not find agetty process however sees a bash ...
0
votes
1answer
61 views

Formatting ps output based on given parent/child processes

Given a list of process names, I want those parent/child processes to not appear in the output of a ps --forest call. This will reduce the processes that I need to look at when I'm tracking things.
0
votes
1answer
36 views

How to record PID and its command every 15s?

For troubleshooting purpose, I'd like to record PID and its command every 15s and write them to a text file. The desired output: TimeStamp, PID, Command
7
votes
1answer
146 views

Why would ps *very* occasionally fail to find a valid process?

I've run into an odd issue in which a ps -o args -p <pid> command very occasionally fails to find the process in question, even though it is definitely running on the server in question. The ...
3
votes
1answer
478 views

ps -a fails to find a process which is running

I could find a process named typora from htop but I cannot trace it from ps or pstree $ ps -a | grep -i typora 9696 ttys003 0:00.01 grep -i typora $ pstree | grep -i typora | |--- 09713 ...
0
votes
1answer
28 views

Upgrade to local ps command to the latest

I am monitoring the process with us on macos $ ps -f UID PID PPID C STIME TTY TIME CMD 501 367 366 0 Sun06AM ttys000 0:00.21 -bash 501 1814 1812 0 Sun06AM ttys001 ...