ps is a command for printing information about running processes

learn more… | top users | synonyms

4
votes
3answers
157 views

Why does `ps -e | less` show 'less' among processes? [duplicate]

I run ps -ejH | less. The output includes ps and less as well. What is the reason? I thought it would work as follows: First, ps will run and it will list all processes existing at that moment. ...
0
votes
0answers
38 views

The usefulness of the top command, and how it may be used with ps and and kill to investigate a system that is misbehaving [on hold]

I'm doing my computer science C/A and one of the questions is: Evaluate the usefulness of the top command and discuss how a computer technician might use it together with ps and kill in order to ...
-6
votes
0answers
26 views

Using “ps” “kill” and “top” to find and resolve problems with executables? [on hold]

OK so for my controlled assessment I need to do some primary research via emails or forum posts. I thought that since I've used this site a lot I would ask here. So say I have an executable file ...
1
vote
2answers
59 views

How to determine which script is being executed by bash?

How would I determine which script is being executed by a process? When I use: ps -u user I get the following output: 10005194 26932 0.0 0.0 112700 1544 ? Ss Jun03 0:00 -bash ...
1
vote
0answers
15 views

WCHAN = 0 for a sleeping task?

I am a little confused about the status of a process I have. It looks like this: $ ps -eal | head -n 1 ; ps -eal | grep perf F S UID PID PPID C PRI NI ADDR SZ WCHAN TTY TIME CMD 4 S ...
0
votes
2answers
72 views

Kill shell script process by name

I have a script running in background like this: nohup /tmp/a.sh & If the script is running for more than 5 mins, I want to kill it. -bash-3.2$ nohup /tmp/a.sh & [1] 2518 -bash-3.2$ nohup: ...
2
votes
3answers
67 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
44 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
26 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 ...
2
votes
0answers
44 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. ...
2
votes
1answer
45 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 pid,ppid,time,user,tty,%cpu,%...
3
votes
1answer
46 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
40 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 ...
2
votes
2answers
28 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.
1
vote
2answers
67 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
52 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
27 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
67 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
63 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
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
694 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
57 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 ...
1
vote
1answer
442 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 $12}'...
2
votes
1answer
75 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 '{ system("...
1
vote
0answers
32 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, 3.13....
0
votes
1answer
85 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
87 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
79 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
35 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
65 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
94 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
83 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 user-...
1
vote
2answers
35 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 ...
1
vote
0answers
39 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
3answers
99 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, ...
0
votes
1answer
96 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 ...
0
votes
2answers
294 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
79 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 ...
2
votes
1answer
42 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
73 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
116 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 > /proc/sys/...
0
votes
3answers
58 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
248 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 ...
1
vote
2answers
47 views

List superuser processes

I am trying to list the superusers processes currently running in my Kali distro. Using "pgrep -f sbin" I figured that would do the trick, however it only lists the PID numbers, not the actual name of ...
1
vote
1answer
134 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" && $...
0
votes
1answer
40 views

Linux applications, user and system

I was wondering if there was any CLI command that would allow me to see what applications are being run by the current user, but ones that are not system commands. for example if I run lsof it will ...
3
votes
1answer
115 views

How to sort ps output to find processes realtime priority and identify processess currently occupied running queue

How to properly identify real-time processes currently occupied CPU queue and count them using ps? I know there is a bunch of fileds like prio,rtprio,pri,nice but do not know correct to use. It seems ...
1
vote
2answers
32 views

Output both ps and Date on one line, to a file?

I am building a rudimentary logging script, and want to capture the output of ps up 12345 So far I have: DATE2=`date +%Y-%m-%d:%H:%M:%S` echo ${DATE2} >> $filename ps up 12345 --no-headers &...
0
votes
2answers
35 views

How I can identify that a process has multiple instances

In my case I have nagios server where nagios service is running. But when I run ps -ef | grep nagios, I can see: nagios 3361 13524 0 15:42 ? 00:00:00 /usr/local/nagios/bin/nagios -d /usr/...