Questions tagged [ps]
ps is a command for printing information about running processes
490
questions
-1
votes
1answer
35 views
Ps aux u shows little CPU usage, but sys_getloadavg() has 3.34
Some time ago our site had been hacked, and we were able to recover successfully, however there still seems to be something weird that we havent got rid off yet. Once per hour, there is a job starting ...
0
votes
0answers
15 views
performance monitoring of “iptables” kernel module
I woul dlike to know, how much CPU / memory my current iptables rules consume.
I tried looking in ps and htop, but even with kernel threads displayed, I don't see anything related to iptables.
How ...
0
votes
0answers
39 views
Linux sorting by using /proc command
how can I instead of that command use /proc to do the same action?
$ ps aux --sort pid
0
votes
0answers
10 views
plist-sz value not matching with actual process running
My plist-sz (sar -q) value is around 28000 but when I check ps -ef |wc -l it shows only around 300. What could cause high value of plist-sz?
1
vote
1answer
32 views
Getting different value for ps command when assigning to a variable
I get a different output when I assign this to a variable. Why is this?
#!/bin/bash
P=$(ps -ef | grep ${APP} | grep -v grep | wc -l)
echo ps -ef | grep ${APP} | grep -v grep | wc -l
echo $P
Output:...
0
votes
1answer
23 views
Get data about system load in an easy-to-process format
Often I feel the need to run some computation on the data about my system load. For instance about the data that top shows. And possibly iotop and htop as well.
Some of the things I'd like to do are ...
0
votes
1answer
29 views
Apache uses 9GB of RAM but htop only shows 2.7GB of used RAM. Why?
My website is very slow at some times of the day, and I'm on the quest of finding out why.
I'm currently looking into Apache memory usage and I have 2 tools that are supposed to tell me how much RAM ...
2
votes
1answer
41 views
ps command: list processes by group id
Here is what I get when I list all processes with -g option:
ps -g -o pid,pgid,ppid
PID PGID PPID
112140 112140 112139
127467 127467 127466
130547 130547 112140
130551 130547 130547
130557 ...
0
votes
2answers
58 views
Command to display only running processes in Linux
Can anyone provide the Linux command to display only the running processes? They should be only running and not in sleeping or other states.
Can we achieve it with the ps command?
I know ps- aF ...
0
votes
0answers
61 views
PS shows different RSS value from Pmap and Smem
I want to get the memory consumption by a process. I am using RSS parameter to determine it.
I am getting same RSS value when I am using pmap -xx <PID> and with smem tool.
But when I am using ...
2
votes
0answers
28 views
Full width of cgroup in “ps -w -w -e -o pid -o cgroup -o cmd”?
ps -w -w -e -o pid -o cgroup -o cmd
shows cmd in full width, but cgroup is truncated:
...
6598 11:devices:/user.slice,6:pi /usr/bin/gnome-screensaver --no-daemon
...
Why is that?
I know that ...
0
votes
2answers
46 views
List top 5 processes for a specific user
I am trying to get the top five processes of a specific user in a bash:
ps -Ao user,uid,comm,pid,pcpu,tty --sort=-pcpu | head -n 6 | grep <username>
However, this selects the top 5 processes ...
4
votes
1answer
36 views
From where does “ps” on Android get user names?
I have an Android tablet that I got a terminal program from Google Play Store. When I issue the "ps" command, it shows various names for the users running the processes. There is no /etc/passwd file ...
0
votes
1answer
78 views
How to get list of processes from N days ago from ps output
How to get list of dates from an output of ps command to only show those processes beyond 30 days?
My goal is to kill these processes. I can easily do this by killall command.
E.g. killall -u user --...
-1
votes
1answer
63 views
What is mean `alloc factor 0.900000 0.900000` after using 'ps -A | firefox'?
My browser stopped responding. I closed firefox, and tried opening it again. Firefox did not run, so I typed ps -A:
7122 ? 01:07:56 firefox-esr
I'm not killing this process, and type:
ps -...
3
votes
2answers
32 views
Is there a way to get the union of `ps a` and `ps x`?
I would like the union of the processes returned by ps a and the processes returned by ps x. When using Docker and nohup, it feels like one or the other of them works, but neither always shows the ...
9
votes
1answer
636 views
Explain why watch 'jobs' does not work but watch 'ps' work?
jobs is my favorite command to see my codes which are running in the background. In order to check for them dynamically, I tend to type
watch 'jobs'
which does not display anything. However
watch '...
0
votes
0answers
28 views
Can I get a process id and run the program in the foreground?
Can I get a process with an id, for example a python script and run the program in the foreground to get the output of the program?
The problem I have is that the output from the processes I get is ...
4
votes
1answer
285 views
Processes in a session in an interactive shell vs in a script
If I run this command in a script it doesn't produce output except header from the ps:
# Taken from Advanced Bash Usage on youtube:
echo "$(echo "$(echo "$(echo "$(ps wwf -s $$)")")")"
This is ...
3
votes
0answers
77 views
What does it mean if a process has an O or an I at the start of the line?
After running ps, I noticed that a couple of the processes had an O at the start of the line. In all my years, I've never seen this. I thought that the meaning of the indicator might be common ...
0
votes
0answers
71 views
PID and process counts do not match from ps with grep output
Using:
Red Hat Enterprise Linux Server release 6.10 (Santiago)
Scenario:
I am trying to automate a process that will capture running processes and put the PIDs and processes into their own arrays, ...
2
votes
1answer
182 views
How can I know if a process is running background or foreground in “ps” or “ps -ef” command output?
How can I know if a process is running background or foreground in commands ps or ps -ef?
I first thought that when I type in ps -ef, there is a section named TTY.
when I look into the list of TTY, ...
2
votes
1answer
71 views
Bash script to count number of executions instances does not work
I am writing a script that detects if there is any instance of it already running on my Linux machine and shows on screen the number of instances.
The content of the "detect_itself.sh" script is:
#!/...
3
votes
1answer
115 views
What does task status PA refer to?
I am looking into a crash dump for RHEL 7.4. It shows some of the task status as PA.
for the command - crash> ps | grep sample
- 31718 31717 3 ffff8806873a6eb0 **PA** 0.0 42260 8040 ...
0
votes
0answers
32 views
Can a process group exist without a process group leader
Saying that I have two bash scripts as below:
#!/bin/bash
# this is test.sh
./test2.sh
and
#!/bin/bash
# this is test2.sh
while :
do
sleep 2
done
After executing the test.sh with the command ....
1
vote
1answer
79 views
Command in a bash script has no effect
I have put a command in a bash script to kill processes as below
#!/bin/bash
kill -9 $(ps ux | grep 'fluent' | awk '{print $2}')
As I run the script, e.g. ./mykill, it has no effect
$ ps ux | grep ...
0
votes
1answer
49 views
Stop multiple processes from command line correctly
I'm executing the following command on mac
./node_modules/.bin/webpack --watch & nodemon dist/server.js
I tried killing the processes using Ctrl+C however i still notice that node processes are ...
2
votes
1answer
835 views
how to avoid garbage option error on grep command
i need to check whether a process is running or not on server. But challenge is , the keyword I am using is not the userid , it's part of the o/p or ps command.
When i am running as ps -ef | grep -v ...
0
votes
1answer
322 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
408 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
72 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
85 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
...
-1
votes
2answers
62 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
1k 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
70 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
115 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
515 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
300 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
261 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
42 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
82 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
291 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
37 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
304 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
3k 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
39 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
91 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
104 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
155 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
330 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 ...