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

Questions tagged [ps]

ps is a command for printing information about running processes

1
vote
0answers
29 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
87 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
28 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
46 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
90 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
60 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
70 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
137 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
59 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
117 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
40 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
33 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 $...
1
vote
1answer
250 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
201 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
31 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
56 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
62 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
45 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
32 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
30 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
131 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
94 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
215 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
33 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
138 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
101 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
21 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
36 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
52 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
32 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
141 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
413 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
25 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 ...
2
votes
1answer
84 views

The counterpart of ps --forest in BSD

I tried to explore the bash on macOS using the process, $ ps --forest ps: illegal option -- - usage: ps [-AaCcEefhjlMmrSTvwXx] [-O fmt | -o fmt] [-G gid[,gid...]] [-g grp[,grp...]] [-u [...
0
votes
2answers
48 views

Search for running script PID by script name

I have the following script hello.sh -------- while : do echo "hello" sleep 20 done And when I ran the above script, I got 2627 as the PID of the script root@localhost ~]# ./hello.sh & [...
-1
votes
2answers
33 views

analyzing ps|wc output

First - i wanted to know how many process are currently running so i used this command: $ ps | wc i was expecting to one number, but the output was: 20 115 844 Three numbers were printed - with ...
-1
votes
1answer
79 views

Return single instance of multiple patterns from grep command

I have the output of a ps -ef command that returns hundreds of lines, and I need to grep for a pattern that is mostly identical, except for the number at the end, and have a single instance of each ...
0
votes
2answers
905 views

ps command the program name

Is there a way to display the program name? Like in windows when you open the task manager, it will display the program name instead of the directory under COMMAND EDIT: Commands I used so far ps ...
1
vote
1answer
53 views

How to log a process's uptime and restarts

I know that I can check a process's uptime with the following: ps -o etime= -p "PID" where PID = pid number. I would like to write to a log when this process ends, and include it's uptime. The ...
2
votes
2answers
152 views

From where is my script started on reboot

Before some days I wrote a script and put it somewhere to get it started automatically on booting on my raspberry with wheezy. ps -ax gives me: 2041 ? S 0:00 /usr/sbin/apache2 -k start ...
2
votes
1answer
129 views

Among these two in my ps output, which real-time process will be preempted over the other by linux?

I have got some idea from: https://stackoverflow.com/questions/8887531/which-real-time-priority-is-the-highest-priority-in-linux about how the real time priority values assigned to different ...
0
votes
1answer
41 views

Why pdftops gives extra padding but pdf2ps doesn't?

I tried both pdftops and pdf2ps to convert a pdf figure(no text) into eps. pdf2ps created a ps figure same to the original one, but the ps file produced by pdftops contains an extra white padding/...
6
votes
1answer
336 views

How shall I generate a pdf file instead of a ps file using enscript?

I was wondering why the following generates a ps file not a pdf file? How can I make it generate a pdf file? Thanks. $ enscript -B -PPDF code/bloom.c -o bloom.pdf [ 2 pages * 1 copy ] left in bloom....
0
votes
0answers
21 views

How long does my Java process run? [duplicate]

@11.3.92.203 $ ps -o etime= -p "55548" 18:19:07 @11.3.92.203 $ ps -o stime,time $$ STIME TIME 08:40 00:00:00 Does this mean my process has running for >18 hours? What about the output of ...
0
votes
1answer
69 views

ps options help, how to report a truncated list of processes sorted by desired columns

Just discovered ps. Spent about 20 minutes reading through the man ps, testing out different options, but only found myself both more intrigued and deeply perplexed by the options. The ordinality and ...
0
votes
1answer
502 views

“error: process ID list syntax error”

I have bash a script that logs in to a remote server, and checks for the number of instances of a desired script script.py running on that server, and subsequently echoes the total memory consumed by ...
1
vote
1answer
260 views

How to pass PID of one process to another process within the same shell script?

Okay, so this might be a very silly question and I don't write shell scripts too often. I'm trying to start 3 processes in the background, one after the another within a shell script, for example: #!/...
4
votes
1answer
488 views

Unrecognized process state output in ps command

Running ps aux in an Ubuntu 18.04 I see some processes having state I, as in... root 1 0.0 0.0 225520 9144 ? Ss 10:36 0:02 /sbin/init splash root 2 0.0 0.0 0 ...
0
votes
1answer
56 views

How does ps measure %CPU per process (and can this be changed?)

When doing ps -r -e -o pcpu=,comm=, the % CPU displayed per process, over how long time is this value measured? Is it one second? The manual page does not seem to mention this. And a follow-up ...
0
votes
1answer
353 views

“Killing” a zombie defunct process without killing its parent

I know there are hundreds of questions on "How to kill a defunct process" but in all of those I found the final answer was: "Don't worry. They don't use any resources." and that basically you either ...