In most Unix-like operating systems, the "ps" program displays the currently-running processes.
Questions tagged [ps]
127 questions
0
votes
1 answer
More elegant ps aux | grep [g]rep do not work
I am running the command: ps -ef | grep [p]ts/1
The result is:
root 13820 1733 0 14:19 ? 00:00:00 sshd: root@pts/1
root 13822 13820 0 14:19 pts/1 00:00:00 -bash
root 15847 13822 0 15:32 pts/1 00:00:00 ps -ef
root …

Iulian
- 3
- 2
0
votes
1 answer
Apache2 seems busy
I have an Ubuntu 14.04.4 LTS server running Apache/2.4.7 and my error.log file is frequently getting this kind of message below:
[Thu Sep 01 19:45:40.571637 2016] [mpm_prefork:info] [pid 1696] AH00162: server seems busy, (you may need to increase…

Rod Elias
- 101
- 1
0
votes
1 answer
How do I list the user that started a service in freebsd
Just a simple question, but I've looked everywhere and can't seem to find this. I just need to know what user started a particular service. In this case, I want to know what user runs the headphones service (headphones plugin in a FreeNAS jail).
I…

compcentral
- 179
- 2
- 7
0
votes
1 answer
How to combine lsof stat and ps to get more info in one line bash command
I can use lsof to get top open files stat for processes, as below:
$ lsof -n|awk '{print $2}'|sort|uniq -c|sort -nr | head -n 5
17955 11945
10282 2786
5980 32152
1920 27803
1786 32107
Now I want to expand the result to like below with…

Y.Huang
- 11
- 1
0
votes
2 answers
How to ensure that the script and its command get killed once terminal is closed
I have written a script and it is working fine . It do some tail and grep operations. When I am closing my terminal and the greping the PID of my script , I can find the script is still present in the output of "ps -eaf |grep -i myScript.sh" .…

monk
- 109
- 2
0
votes
1 answer
How can I log a linux command's process tree?
I'm trying to track the usage of a certain command so I want to log its parents (to see what is actually using it)
Solaris has "ptree" which would be pretty easy to parse and log:
# ptree 4198
4198 /usr/bin/perl -S /sample.pl
4228 /usr/bin/java…

wsaxton
- 195
- 11
0
votes
2 answers
ps aux shows only processes of the current user
On one of my servers running Debian 7.8, when I run ps aux, I only see processes belonging to the current user.
If I check the permissions with sudo ls -al /proc/, procesess run by root have theses permissions:
dr-x------
Whereas on my other Debian…

Rudloff
- 59
- 1
- 9
0
votes
2 answers
Print last column containing spaces and special characters
I need a full path/command thats been execued to start a process thats exposed on the network - listens on tcp/udp . I did manage to get all of that using below "one liner":
netstat -nlp46|tail -n +3 | while IFS=" " read -r -a line;
do…

Pavel K
- 78
- 6
0
votes
1 answer
how to view all process details from ps –ef command
hi all
I am using the ack.pl in my bash script to search IP's in the Linux OS
only for example , and only to show the problem I will give here short example
# ( ./ack.pl -Q -a -l --max-count=1 --ignore-dir=log --ignore-dir=logs --ignore-dir=lib …

maihabunash
- 443
- 1
- 11
- 25
0
votes
1 answer
Script that checks and runs a jar, sometimes runs it twice.
I jave written a small bash script to run every 10 minutes, check if a certain program is running and if not run it. However, I noticed that sometimes I have two instances of the same program running (using ps ax | grep "gateway"). What am I doing…

xpanta
- 159
- 2
- 10
0
votes
0 answers
Nginx - change status code based on grep of process list or similar
We are using nginx as a reverse proxy in our cloud infrastructure, and it's pretty handy. I'd like to use it for something else though. On some of our VMs, there is a process that I need to be able to confirm is running. Ideally, I'd like to have…

SamBarham
- 143
- 1
- 1
- 4
0
votes
1 answer
Cron job running twice
I have a ubuntu linux ec2 instance running on AWS. Upon entering the command ps -ef to view all currently running processed, I see
root 2346 944 0 06:08 ? 00:00:00 CRON
ubuntu 2347 2346 0 06:08 ? 00:00:00 /bin/sh -c…

Lance
- 143
- 1
- 7
0
votes
0 answers
Invalid format output from ps etime
We have some scripts that run to detect long running processes. It works using ps and etime
e.g
ps -eo uid,pid,etime
This part works fine except that occasionally we get an etime back with an invalid format
2000 20453 1158050441-07:00:15 sh
All of…

Ryaner
- 3,097
- 5
- 25
- 33
0
votes
1 answer
different result of counting the number of processes with ps command
Script A :
#!/bin/bash
cmdname=$1
process_num=$(ps -e | grep $cmdname | wc -l)
timestamp=$(date +%s)
echo -e "$timestamp\t process_num=$process_num"
Script B:
#!/bin/bash
cmdname=$1
process_num=$(ps -ef | grep $cmdname | wc -l)
timestamp=$(date…

hywl51
- 101
- 1
0
votes
1 answer
Why does a suspended process show high CPU usage in ps?
Sometimes when a process is suspended (in T state) the output of ps shows the process using an unusual amount of CPU%.
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
cossey 8697 26.9 0.0 8808 672 pts/3 T 09:25…

Ecolitan
- 228
- 1
- 6