ps is a command for printing information about running processes

learn more… | top users | synonyms

2
votes
3answers
55 views

How to count the number of instances of a certain process by canonical path (with arguments)?

Title might be a bit confusing, let me clarify.. Let's say I run the following commands: sleep 500 /bin/sleep 500 sleep 30 What I'm interested is, how to count the number of instances of the sleep ...
1
vote
3answers
41 views

Do not produce output when process does not exist

I would be happy if the following command produced no output if tail was not running: ps --no-headers $(pidof tail) Instead I get: 964 pts/2 00:00:01 bash 4393 pts/2 00:00:00 ps
3
votes
1answer
24 views

Is it possible to add description to qemu VMs?

Is it possible to add description to qemu virtual machines? I mean something similar to qemu -enable-kvm -description "RHEL test-host" .... This would allow one to easily identify virtualized hosts in ...
-1
votes
0answers
44 views

How to programatically change the Ubuntu 16.04 System Monitor process name from cli or mono to an unique name? [closed]

I wrote and tested the following C++ program after reading the Stack Overflow article , [http://stackoverflow.com/questions/31747247/change-real-process-name-in-c-on-linux.] I discovered my ...
0
votes
2answers
4k views

`ps | grep | kill` aborts my script prematurely [duplicate]

I have a Linux computer that I remotely SSH into using plink on a Windows XP machine. I have a Plink program set to execute commands in a script using automated login: plink -ssh [domain name] -l ...
2
votes
1answer
39 views

Highlight nth column of ps output

I'm trying to find the best way to highlight a specific column of some output. Specifically, I'm trying to highlight the 9th column (which is %cpu of the command: ps -eo ...
2
votes
0answers
39 views

How to get the executed command of a process which has completed successfully using the PID?

I have small script, abc.ksh that takes 3 parameter e.g abc.ksh ${a} ${b} ${c} I will read from a config file with 'n' no of entires and I will execute abc.ksh 'n' times in parallel using a for loop. ...
4
votes
3answers
7k views

Why is apache2 showing up a defunct in the process list?

When I run top I see one line that doesn't look too good: 2475 www-data 20 0 0 0 0 Z 1 0.0 0:00.19 apache2 <defunct> Why is this process <defunct> and what should I ...
3
votes
1answer
31 views

How to make the Ubuntu Linux 16.10 System Monitor % CPU utilization agree with ps or top for a Firefox process on quad core CPU?

I would like to make the Ubuntu Linux 16.10 System Monitor % CPU utilization measurement basically agree with the ps "pcpu", % CPU utilization for an individual Firefox browser process running on a ...
0
votes
1answer
35 views

Discrepancy between Ubuntu 16.10 System Monitor % CPU and ps pcpu, % CPU utilization with respect to the individual Firefox browser process

What is the reason for the following discrepancy between Ubuntu Linux 16.10 System Monitor % CPU utilization and ps pcpu, % CPU utilization with respect to the individual Firefox browser process? For ...
1
vote
1answer
66 views

Difference between ps process httpd and deamon process httpd

When I'm running command ps aux | grep httpd , it shows that httpd is in running state, but on running systemctl status httpd - its inactive and disabled. Why is it so?
2
votes
2answers
25 views

Process Scheduling Information Extraction

I want to extract the process having highest utilization on each processor core and then output its information (PID etc.) to a file. How can I do it by using either top or ps command? Thanks.
5
votes
1answer
7k views

What is the difference in CPU utilization between 'ps aux' and 'ps -ef'?

I use Ubuntu 12.04.1 Linux. I see a difference between %CPU and C output format of ps command for a process. It is not clearly noted in the ps man page. Man pages says: CODE HEADER ...
2
votes
4answers
2k views

I want to kill all processes that result from the following command

The following command will display all the PID's running for vmstat1: ps -ef | grep "vmstat 1" | awk '{ print $2 }' My question is, how do I kill them all, if there's like 20 of them at once?
1
vote
1answer
100 views

Why do I get the message set no match when I run this script?

#! /usr/bin/tcsh -f set ps_output = "`ps -u $user`" @ i = 2 echo "$ps_output" set ps_test while ( $i <= $#ps_output ) set line = ( $ps_output[$i] ) if ( $line[4] != "ps" && ...
1
vote
2answers
55 views

Grep command using contents of a heredoc

I'm creating a script to update a remote computer and I want to know if any user is using the computer before I update. I have a list of users and I created a heredoc with all of them. The command I'm ...
2
votes
1answer
25 views

Why do processes not fill up empty process IDs

Everybody knows that PID number 1 is systemd (or something equivalent). And every process after that takes another PID, counting up. However when there are 50 processes running (up to PID 50) and ...
1
vote
1answer
47 views

Get the process start time irrespective of NTP updates

I'm trying to record the start time of a process kicked off by an @reboot cronjob. I'm using ps -p $$ -o ltime= presently, but I've run into a catch. My machine (a Raspberry Pi) connects to the ...
1
vote
1answer
26 views

Output of ps lstart changed

I started a program and wrote the output of ps -p PID -o lstart= to a file, like so: $ long_running_command & [1] 4562 $ ps -p $! -o lstart= > start_time $ cat start_time Wed Apr 6 06:16:31 ...
1
vote
1answer
52 views

What are these processes and why can't I kill them?

(On OS X 10.11.3) I'm having a problem starting a java process that needs to listen on port 8040. Getting a BindException. So seems like somebody else is already listening on it. A quick check ...
-2
votes
5answers
61 views

How to find PID of an ongoing job in UNIX?

I executed a shell script which will call some internal applications and will take few hours. Due to some problems, I have to stop or kill that job. For this, first of all, I ran ps -u $uname to list ...
1
vote
1answer
425 views

List of running processes

There is a top command to show running processes. I would like to print sorted list of unique values in field COMMAND. There is my solution for this task $ top -b -n 1 | tail -n+8 | awk '{print ...
4
votes
2answers
2k views

How to get start time for a defunct process on AIX?

When I run the following commands on AIX: 22:root@SERVER:/root # ps -ef | head -1 UID PID PPID C STIME TTY TIME CMD 22:root@SERVER:/root # ps -ef | grep defunct | head -1 ...
1
vote
2answers
33 views

Search for processes which are CPU consumming

I can track the process launched by the user4 with awk: ps aux | awk '$1~/user4/' And also to track what process consume more than 10% CPU: ps aux | awk '$3> 10' Hoe the question is not too ...
13
votes
5answers
648 views

How to get the tty in which bash is running?

In the second method proposed by this page, one gets the tty in which bash is being run with the command: ps ax | grep $$ | awk '{ print $2 }' I though to myself that surely this is a bit lazy, ...
1
vote
1answer
54 views

Script to ensure that only one instance of Oracle is running

I'm an Oracle DBA and need help/suggestion to understand a weird situation that came up today. One of our DBA job failing with saying 'Already its running' from Tivoli scheduler. However that is not ...
0
votes
1answer
3k views

Linux ps -elf command output, what is Process Flag meaning?

In output of ps -elf command in linux, we can recognize that process flag of 4 and 1, and process flag of 5, (sum of 1 and 4), but what is meaning of process flag 0 ? unfortunately, man does not help ...
2
votes
1answer
60 views

I can't find the process sending mail?

I did something stupid and ran an awk that runs a while loop that sends an email every 10 seconds. I ran this as a background process: egrep '^[1-9]' /etc/hosts | grep -v 'localhost' | awk '{ ...
1
vote
0answers
30 views

CPU usage according to ps and operf

I've acquired some data seemingly in conflict from two sources one would assume are reliable. In all likelihood, I'm misreading one of the sources. The server environment is: Ubuntu 14.04.2 LTS, ...
122
votes
12answers
46k views

How can I prevent 'grep' from showing up in ps results?

When I search for some process that doesn't exist, e.g. $ ps aux | grep fnord wayne 15745 0.0 0.0 13580 928 pts/6 S+ 03:58 0:00 grep fnord Obviously I ...
0
votes
1answer
64 views

aix: how to sort ps by stime?

On AIX, for the top 10 cpu processes, I use ps aux | head -1; ps aux | sort -rn +2 | head -10 for the top 10 mem processes ps aux | head -1; ps aux | sort -rn +3 | head -10 How can I sort the ...
4
votes
1answer
76 views

-p option of ps

If one omits the -p option in the the ps in Linux, it is implied if a number is given. man ps says 123 Identical to --pid 123. and --pid pidlist Select by process ID. ...
3
votes
2answers
69 views

How can I kill process by specific name and exclude root processes

Not a long time ago we found out about pkill and we had in mind to start using it in a setuid (for root) script for global clean-up of processes. This could save us lots of stupid maintenance where ...
1
vote
1answer
31 views

pgrep full match not work, only part, why?

I use pgrep from procps-3.3.10. If I have executable aout_abcdefgh_ver27, then pgrep aout_abcdefgh_ver27 returns nothing, while ps aux | grep aout_abcdefgh_ver27 returns the expected result: ps ...
2
votes
0answers
64 views

Why does my Linux server hang with “ps aux”

I have a server running scientific computation applications. It is SLES 11sp3. Here are some of my observations: I could login to the server with ssh. But for some reason I don't understand, when I ...
2
votes
1answer
83 views

Bring process to 'foreground'? [duplicate]

I am using an SSH client to connect to a Solaris server. I had a process running but my connection disconnected. I reconnected and can see the process running when I do ps -al. How can I bring this ...
0
votes
1answer
71 views

ps: output modifiers vs output format control

In the manpage of ps -j Jobs format. -f Do full-format listing. -o format User-defined format. $ ps -j -o ppid,sid error: can not use output modifiers with ...
1
vote
2answers
31 views

Find all idle screens

I have started a few processes in the past initiated via the screen command. Most of those scripts have already finished running, but looks like the screens are still sitting there idle. I can see ...
0
votes
3answers
87 views

How to stop a user from seeing command line arguments?

We have a CI server application run as the build user. Any command with arguments run by the CI server is visible via ps. Although non-admin users do not have access to load a shell on the CI server, ...
1
vote
0answers
38 views

List services with port numbers

I would like to list all installed services (especially running) with their port numbers, where they are assigned. Could you be so glad and help me with this command?
0
votes
1answer
77 views

How can I show a terminal shell's process tree including children?

When a script is launched from command prompt the shell will spawn a subprocess for that script. I want to show that relationship between terminal level process and its children using ps in a tree ...
12
votes
3answers
13k views

ps: full command is too long

Good day! I use 'ps' to see command that starts process. The issue is that command is too long and 'ps' does not show it entirely. Example: I use command 'ps -p 2755 | less' and have following ...
0
votes
2answers
169 views

How does the ps command work?

For an assignment I need to implement my own version of the ps command, but I'm not sure where it gets its information from. Where do I look to find all process information?
1
vote
1answer
58 views

Possible to identify defunct process from pgrep

I am using pgrep for a bunch of things, however I can't get pgrep to list if the process is defunct. Running ps adds to the end of the item <defunct> but pgrep does not, is there anyway to do ...
1
vote
1answer
31 views

pgrep only current user

I was wondering what the arguments were for pgrep to make it act only on the current user. -u makes me provide names, I don't know the name of the current user, I just know that I need current user ...
4
votes
3answers
63 views

How do I get the first branch PID of an application in pstree command?

I want to get PPID of chromium browser. When I launch chromium-browser it launches many child processes with the same name. For example: $ pidof /usr/lib/chromium-browser/chromium-browser 8963 ...
1
vote
0answers
99 views

Periodically get CPU usage for single process

I've got a problem with the kswapd0 process (pid 52), which from time to time would start to use 25% of the cpu (one full core). I usually stop it with the command sudo sh -c "echo 1 > ...
0
votes
3answers
56 views

Process in Unix

When I log into my unix terminal and just do ps: bash-4.3$ ps PID TTY TIME CMD 7 pts/0 00:00:00 sh 16 pts/0 00:00:00 bash 17 pts/0 00:00:00 ps I know bash process is ...
2
votes
2answers
190 views

Is there any way to hide kernel threads from ps command results?

When I type ps -ef , there are lots of special kernel thread processes showing. I am not interested in kernel threads; I am only interested in user process/thread. Is there a way that I can hide the ...
2
votes
2answers
45 views

How to view all ancestor processes?

How can I view all the ancestors for all instances of a given process name?