Skip to main content
OverflowAI is here! AI power for your Stack Overflow for Teams knowledge community. Learn more

Questions tagged [ps]

In most Unix-like operating systems, the "ps" program displays the currently-running processes.

Filter by
Sorted by
Tagged with
1 vote
1 answer
370 views

The ssh-agent process is not visible to the user who created it but is visible to root

I have adopted the following snippet from Visual Studio Code's documentaion to create an ssh-agent on login: if [ -z "$SSH_AUTH_SOCK" ]; then # Check for a currently running instance of ...
Matt's user avatar
  • 111
0 votes
0 answers
81 views

Confusing Memory output from top/ps aux (over 600% memory allocated)

I'm trying to get to the bottom of an issue where the oom-killer is killing certain jobs off on a server. The server has 48GB of physical ram, with 20GB of swap, and I'm trying to find out what ...
sleepysysadmin's user avatar
0 votes
1 answer
335 views

How to get users running processes without it's username in it?

I'm trying to write all users and their running processes in file using: ps -r -U username -o pid,command,user > up.txt But I don't need commands that contains users name in it. How can I filter ...
FeoJun's user avatar
  • 1
1 vote
2 answers
2k views

Why does `ps -x | grep foo` include the grep command?

I know that it does (often) include the grep process and I know adding | grep -v grep or grepping on [f]oo instead will prevent it, but my question is more about order of operations I guess. For ...
jhericks's user avatar
  • 113
4 votes
3 answers
14k views

Identify processes running inside Docker, in Process List

I realize that processes that run inside Docker containers appear on the hosts' process list: # ps aux | grep mariadb root 12486 0.0 0.0 112812 976 pts/0 S+ 14:47 0:00 grep --color=auto ...
Nuno's user avatar
  • 643
1 vote
0 answers
91 views

Outdated processes in ps aux

Some servers in the cluster have a lot of irrelevant processes in the process list. There are hundreds of them and some of them are about 2 years old. root 9903 0.0 0.0 10752 180 ? Ss ...
Mystic's user avatar
  • 23
-1 votes
2 answers
2k views

How to connect to remote server using powershell from local . Enter-PSSession not working ( Not Related Exchange Service )

I am trying to connect to remote computer using local powershell session. for that I am trying to use local powershell Enter-PSSession or New-PSSession comandlets as : $session = New-PSSession -...
Usman's user avatar
  • 117
0 votes
1 answer
2k views

sar and top show high cpu usage, but vmstat and ps show low cpu usage. Why?

I'm diagnosing a high CPU usage event, and I found a weird difference between numbers from ps/vmstat, which show almost 0%, and sar/top, which show almost 100% (user + system): sar 1 5 Linux 2.6.9-67....
Emerson Prado's user avatar
3 votes
1 answer
691 views

ps command output does not display wchan values in fedora

I am running fedora 5.3.12-200.fc30.x86_64 and testing simple tcp client/server codes. I tried running different ps commands but I can not get any value displayed in wchan field, although in my case ...
Зоран Пантић's user avatar
0 votes
1 answer
2k views

linux - ps have different column with process ID

I have simple Docker's command to kill database process: docker exec app-pgsql bash -c 'ps axuf |grep ils |cut -d" " -f3 |xargs kill -9 || :' and as you can see, I'm looking for 3rd column from ps ...
Damian's user avatar
  • 133
0 votes
1 answer
1k views

ps + kworker with state D

we have redhat machines in cluster redhat version is - 7.2 when we perform ps ax on the machine we saw many kworker with state D example 17165 ? D 0:00 [kworker/u66:1] 2151 ? D 0:58 [...
shalom's user avatar
  • 501
2 votes
1 answer
3k views

Enter-PSSession : Connecting to remote server failed

I have three VMs: A, B and C. I use Enter-PSSession to connect them. But recently connecting B from A (A->B) never succeeds. Others ways (A->C, C->A, B->A, B->C, C->B) have no problem. The error ...
liupro925's user avatar
0 votes
1 answer
162 views

invisible php process on linux

I have a php script running in an endless loop on my Linux server. I know it's running because it's the only script that does X, and X is definitely happening. However, it's not listed in crontab, and ...
Ingrid's user avatar
  • 1
1 vote
2 answers
941 views

How to tell threads from processes in top and ps on Linux?

I find it quite confusing to differentiate threads and processes when I run top and then press H or run ps -Hef. I know that they share the same attributes, which makes them similar but was wondering ...
user's user avatar
  • 23
0 votes
1 answer
173 views

Unable to fork children even after exiting previous ones

I have a CentOS VM on which I'm running a php socket server, that forks on every connection. The child process does its job and then exits. The parent is also waiting to reap the dead zombie process (...
Dushyant Bangal's user avatar
1 vote
1 answer
513 views

Why does my "ps aux" command column now show gibberish?

While using ps aux to find the PID of a process, I came across some output that prevented me from doing so. I've done this before, on this same server, within the last month. Today's output looked ...
Robert K's user avatar
  • 592
1 vote
1 answer
355 views

Ubuntu ps command showing wrong values in START column

I have just noticed that my server has wrong value in START column of ps 's output. It always display 2017 value, while it should show hour:minute format. The problem is not fixed after I reboot the ...
Lan Pham's user avatar
0 votes
1 answer
45 views

Script to list httpd instances

I have a RHEL7 server (no GUI) running several distinct instances of httpd (distinct PID files, not defined as services...don't ask). Trying to build a simple script that will tell me which of my ...
Felix's user avatar
  • 51
0 votes
1 answer
216 views

Process start time and running time do not match

We have a situation where times present by START TIME and TIME presented by "ps" are not matching. When I say matching I mean - TIME shows that a service is running longer than it actually is. ...
py9's user avatar
  • 101
0 votes
2 answers
1k views

User shown in ps does not exist

This is strange: » ps -ef | grep gitlab gitlab-+ 19663 4237 0 06:45 ? 00:00:00 postgres: gitlab gitlabhq_production [local] idle But the gitlab-+ user does not exist: » cat /etc/passwd | ...
blueFast's user avatar
  • 4,390
1 vote
1 answer
735 views

ps sniffing on mysql password

I am passing the password to a mysql connection via a script using : mysql -u root -p'mypass' so I can execute task on that line using --execute. I have seen in many stackexchange forums that ...
Simon Ernesto Cardenas Zarate's user avatar
0 votes
0 answers
836 views

Is there any way to sort processess by UNshared (private) memory use in ps or top?

I've been able to calculate unshared memory use by summing anonymous and stack mappings from pmap -x e.g. sudo pmap -x $THE_PID |egrep 'anon|stack' | awk '{print $2}' | paste -sd+ | bc but can't ...
Craig Ringer's user avatar
  • 11.3k
2 votes
1 answer
306 views

AWS / EC2 / Ubuntu 16.04: apache2 processes although apache is not installed?

I created an AWS Ubuntu 16.04 EC2 instance a while ago and had it running for some time not really doing anything. Now as I try to bring that machine bring to service, I notice a few things I can not ...
ssc's user avatar
  • 1,189
1 vote
1 answer
3k views

How to hide a password from ps, if it's given to a process via script or command line

So I have a certain program, which is running almost 24/7. I have a start script I've written in bash which simply does: ./app --user XXX --pass YYY There are a few more options, but they are ...
Sam's user avatar
  • 11
0 votes
1 answer
3k views

How to get ps output with headers [duplicate]

The question is basic, How to get output of ps with headers in Linux. Linux details: PRETTY_NAME="Debian GNU/Linux 7 (wheezy)" NAME="Debian GNU/Linux" VERSION_ID="7" VERSION="7 (wheezy)" I can get ...
Saurabh's user avatar
  • 123
2 votes
1 answer
617 views

Process claims to use a lot of memory, but 'free' indicates that the memory is still free

I've seen the opposite of this, but this is puzzling. In short, I have a process where %MEM claims to use 74% of memory when using 'ps' and 'top'. However, 'free' shows that I'm only using 32% of the ...
Joel Griffiths's user avatar
2 votes
1 answer
598 views

how to find Linux processes started at a certain time

I am trying to debug Linux vnc session that is not responding. I think I clicked the KDE konsole icon and that is when the vnc session became frozen. I can see the windows and menu in KDE but nothing ...
user2979872's user avatar
0 votes
2 answers
438 views

Discrepancy between "ps aux" and the 1-minute average server load

I am a Linux rookie, so I'm trying to figure out a discrepancy. The problem is that the 1-minute average load available in /proc/loadavg doesn't make sense when compared to the output of the "ps aux" ...
Jeff's user avatar
  • 27
0 votes
2 answers
550 views

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 ...
Iulian's user avatar
  • 3
0 votes
1 answer
2k views

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] ...
Rod Elias's user avatar
  • 101
0 votes
1 answer
3k views

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 ...
compcentral's user avatar
1 vote
2 answers
1k views

Access /proc/$pid/exe as regular user

I am in the process of developing a custom Nagios plugin to monitor the absolute path of a few running processes. As a root user I have always used the command 'ls -l /proc/$pid/exe to find the path ...
Debianuser's user avatar
1 vote
1 answer
562 views

ps output is not correlated to free command?

I am getting sum of all reserved memory in KBs by using following command:- ps aux --sort -rss | awk '{sum +=$6} END {print sum}' OUTPUT: 14746220 i.e. 14.74GB However free -g returns 27GB as used. ...
Mangat Rai Modi's user avatar
0 votes
1 answer
896 views

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 ...
Y.Huang's user avatar
  • 11
-1 votes
1 answer
3k views

is there a way to pretty print the output of "ps" to include the "rss" memory value?

I have a python script which takes in processes in csv format and decides things based on what's running, it's name, and how much cpu time it's using. I would like to add processes that also use lots ...
Rusty Weber's user avatar
8 votes
2 answers
46k views

Unix / Linux command to see finished or killed processes

Is there a way to see processed that finished running or were killed a given amount of time ago? For instance, ps -ef will show all running processes, but if a process finishes, it is no longer ...
Rooster's user avatar
  • 515
4 votes
1 answer
5k views

extra sshd root instance

I have logged in to my server running Centos 7 via ssh and executed the following command: [me@server ~]$ ps -ef --forest | grep ssh root 476 1 0 Dec02 ? 00:00:00 /usr/sbin/sshd -D ...
Skeeve's user avatar
  • 195
0 votes
2 answers
85 views

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 ...
monk's user avatar
  • 109
-2 votes
1 answer
1k views

How to cut the result of ps command

Could you please explain this command? and what does 48 means ? ps -laef | cut -c 48- | sort | uniq -c | sort -n Thanks in advance
Adam's user avatar
  • 1
1 vote
1 answer
2k views

In the output of ps(1) on OS X-like systems, what do processes listed in parentheses mean, and how do I kill them?

username@yosemite ~ % ps wwwaux | grep java username 48111 0.0 0.0 0 0 ?? ?E 11:54AM 0:00.00 (java) username 91673 0.0 0.0 2432772 508 s006 R+ 3:19PM 0:...
javanix's user avatar
  • 247
0 votes
1 answer
2k views

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 ...
wsaxton's user avatar
  • 195
0 votes
2 answers
3k views

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 ...
Rudloff's user avatar
  • 59
3 votes
3 answers
8k views

How to change time format to seconds in ps -p?

I wrote a rsync script which also checks for how long the process of the script has been running. This is the relevant part: time=$(ps -p $processid -o etime= | awk -F: '{print $2}') # number of ...
Itai Ganot's user avatar
  • 10.9k
6 votes
3 answers
3k views

Wchan section in ps output not showing anything

I know that if a process go into D state then it means that it is in uninterruptable state. The process can not be killed by any signal. It will only come out of that state on reboot or if I/O wait is ...
shivams's user avatar
  • 509
-2 votes
3 answers
22k views

How to terminate a process(httpd) when its PID keeps on changing in CENTOS 7

When I tried to restart my httpd service using systemctl restart httpd Checking the status, I found that process is dead and another process is running. so I removed it using yum erase httpd As a ...
Anup Sharma's user avatar
2 votes
1 answer
2k views

ps is giving a segmentation fault

I'm getting a segmentation fault when I try to run a simple "ps aux" for a certain user. If I run as root or another user it runs well. So I think is something related with ulimits, but I think that ...
julian's user avatar
  • 153
0 votes
2 answers
785 views

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 ...
Pavel K's user avatar
  • 78
5 votes
2 answers
14k views

ps show column name

Using these ps options I cut 10 lines and order output of ps by cpu usage (pcpu): ps -eo pcpu,etime,pid,user,args --no-headers| sort -t. -nk1,2 -k4,4 -r |head -n 10 I need also show the name of ...
watchmansky's user avatar
1 vote
0 answers
125 views

"normal" number of processes/threads

Considering a standard LAMP server (aka webhosting) what should be a limit at number of processes/thread? ps -elfT | wc -l 475 "Limit" I mean: on DDOS probably the numbers of children-processes of ...
watchmansky's user avatar
1 vote
5 answers
4k views

Get the pid if 2 tomcat(s) is running

I have 2 tomcat's running, how do I get the pid if both have similar names? ps -ef | grep java root 12952 1 0 10:01 pts/0 00:00:03 /usr/lib/jvm/jre/bin/java -Djava.util.logging.config....
user3789893's user avatar