Questions tagged [ps]

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

Filter by
Sorted by
Tagged with
0 votes
0 answers
52 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 ...
0 votes
1 answer
82 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 ...
  • 1
0 votes
0 answers
110 views

Strategies for detecting daemon memory leaks

I have a system which sends an email to a user twice a day, confirming that a specific daemon is still running and doing something. This has historically run for over a year without a restart, but the ...
  • 71
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 ...
  • 113
2 votes
3 answers
8k 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 ...
  • 501
1 vote
0 answers
51 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 ...
  • 21
-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 -...
  • 117
0 votes
1 answer
1k 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....
3 votes
1 answer
587 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 ...
0 votes
1 answer
1k 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 ...
  • 123
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 [...
  • 451
2 votes
1 answer
2k 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 ...
0 votes
1 answer
101 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 ...
  • 1
0 votes
1 answer
401 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 ...
  • 13
0 votes
1 answer
90 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 (...
1 vote
1 answer
313 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 ...
  • 542
1 vote
1 answer
287 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 ...
0 votes
1 answer
40 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 ...
  • 51
0 votes
1 answer
77 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. ...
  • 101
0 votes
2 answers
737 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 | ...
  • 4,040
1 vote
1 answer
581 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 ...
0 votes
0 answers
480 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 ...
  • 10.7k
2 votes
1 answer
258 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 ...
  • 1,149
1 vote
1 answer
2k 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 ...
  • 11
0 votes
1 answer
2k 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 ...
  • 123
2 votes
1 answer
393 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 ...
2 votes
1 answer
356 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 ...
0 votes
2 answers
355 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" ...
  • 27
0 votes
1 answer
398 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 ...
  • 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] ...
  • 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 ...
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 ...
1 vote
1 answer
332 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. ...
0 votes
1 answer
851 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 ...
  • 11
-1 votes
1 answer
2k 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 ...
6 votes
2 answers
38k 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 ...
  • 495
4 votes
1 answer
4k 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 ...
  • 195
0 votes
2 answers
77 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 ...
  • 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
  • 1
1 vote
1 answer
1k 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:...
  • 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 ...
  • 195
0 votes
2 answers
2k 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 ...
  • 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 ...
  • 10.5k
5 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 ...
  • 459
-2 votes
3 answers
19k 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 ...
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 ...
  • 153
0 votes
2 answers
648 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 ...
  • 78
4 votes
2 answers
12k 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 ...
1 vote
0 answers
116 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 ...
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....