ps is a command for printing information about running processes

learn more… | top users | synonyms

1
vote
0answers
31 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
38 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
46 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
33 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
42 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
27 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
22 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
25 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
25 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 ...
4
votes
0answers
159 views

What processes are used by DRM?

Whenever some content is DRM-protected, screenshots of such content are masked. Even using Terminal does not avoid such problems. Which processes in ps ax are used by DRM that is implemented by ...
2
votes
2answers
111 views

How to set an indentifier for multiple background processes?

I'm creating a custom game server and I have a .jar file to run it. I need to launch multiple game servers on a single virtual machine(like 15). I found, that I could just run them like this: java ...
0
votes
1answer
23 views

how to get PID and State of certain Processes

I have created a basic shell script that simply counts down from 1000. This is just for testing but could be any application/process. ##filename:test.sh## #!/bin/bash i=1000; while [ $i -gt 0 ]; do ...
2
votes
1answer
66 views

See if a script is running when using #!/usr/bin/env

I have tried migrating the shebang for my bash scripts from #!/bin/bash to #!/usr/bin/env bash, and some of them were broken because they relied on this code that checks for existing instances of ...
4
votes
2answers
52 views

How do I find the PID of a particular program?

I would like to write a Bash script that searches for PIDs matching a program's name (perhaps using ps ax | grep <PROGRAM> or something similar) and feeds them to pixelb's ps_mem script. ps_mem ...
1
vote
2answers
23 views

View current user process ancestors and formating the output

I'm using ps -eo ppid,pid,cmd to view all process, and how can I format the output to view like below? Only given PID and its ancestor will print (until init). 23464 current | 23211 bash | ...
3
votes
1answer
135 views

Sorting the output of ps does not work

I want to sort the output of the following command based on pcpu: ps -p 29492 -L -o pid,tid,psr,pcpu I tried the following: ps -p 29492 -L -o pid,tid,psr,pcpu --sort=pcpu But it doesn't seem to ...
2
votes
2answers
38 views

How to view all ancestor processes?

How can I view all the ancestors for all instances of a given process name?
0
votes
1answer
16 views

Help with the PS and TTY?

I have this question for you guys: I execute on a different shell 'sleep 600'. I open a different terminal and I executed 'ps' to see my current process , however , I dint see any sleep process. I ...
1
vote
2answers
71 views

Shell script to kill processes except those owned by user

I am Looking for some help in creating a script to kill processes, but return an error message if they are owned by root. Firstly I would like to say that I am a total beginner at this. At the moment ...
2
votes
2answers
59 views

How to get the title of the media playing in VLC or other media players using CLI?

I want to get the title of the media playing in VLC using the Command Line. The closest thing I currently have is this command. ps aux | grep vlc The output is pc 27636 2.1 2.3 1261964 ...
3
votes
2answers
40 views

How to find what processes run by the user right now?

Once again, I'm a beginner and I can't find the right command. I want to view the processes that I'm currently running.
0
votes
2answers
59 views

Creating an automated idle process kill script

I would like to implement a solution to a specific instance of the generic problem wherein idle users tie up resources. I know the user list can be retrieved with 'w', the associated PID with 'ps', ...
2
votes
3answers
82 views

How do I convert the output of ps(1) to JSON?

I want to convert the output of the command ps to JSON in order to process it as structured data (with jq in this particular case). How do I do that? The output looks like the following: PID TTY ...
3
votes
1answer
82 views

ps wide output for a single process

The ps command has a ww output modifier (man page says this is "wide output, unlimited length"). This modifier seems to not work if prefixed with a hyphen (-ww) AND ps reports on a single process ...
4
votes
3answers
106 views

How to show quoted command list?

ps -o command shows each command on a separate line, with space separated, unquoted arguments: $ ps -o command COMMAND bash ps -o command This can be a problem when checking whether the quoting was ...
2
votes
0answers
21 views

List all processes without controlling terminal (only)?

Is there a portable way to do this? On Linux, I can use ps a -N but this option isn't available on other (POSIX) systems. Of course I can use grep '^?' with, say, -o tty,... but is there something ...
1
vote
1answer
36 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?
0
votes
1answer
31 views

Display non-printable parameters in running processes

ps aux displays commands running on the server, but it does not display non-printable parameters in any sort of way that is useful. mycmd.sh: #!/bin/bash while true do sleep 5 done ...
2
votes
1answer
43 views

how to get processor that thread is currently assigned to?

I've found such column in ps -elF: PSR processor that process is currently assigned to. I need something similar but for threads. ps huH p 1234 prints threads of process 1234, can I somehow add ...
3
votes
3answers
73 views

How to get the pid to the last background app

Following from this question: How to get the pid of the last executed command in shell script? The thread there is good and clear, but what if the command actually doesn't require a '&' at the ...
2
votes
1answer
29 views

Strange behavior of 'ps -o pgid'

Intro: I have a daemon, which spawn processes and I have to stop it all gracefully. The solution I found on web based on pgid: group_id=$(ps -o pgid= $(cat $pidfile)) if [ ! -z $group_id ]; then ...
1
vote
1answer
72 views

ps aux on aix,how to get PPID?

I know is possible with ps -ef But i want to get it with ps aux How to do it on aix? Thanks
0
votes
1answer
144 views

ps finds process, kill doesn't [duplicate]

Specifications [midas@localhost ~]$ uname -a Linux localhost.localdomain 4.0.4-301.fc22.x86_64 #1 SMP Thu May 21 13:10:33 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux and [midas@localhost ~]$ cat ...
1
vote
4answers
332 views

Disabling column names in ps output

How to format output of ps -p command? To not show me something like this: PID TTY TIME CMD but just PIDs. I'm using Linux.
4
votes
1answer
83 views

Why does a process of a binary with only execute permission remain hidden in “ps” when using hidepid=2, if the user is not root?

I'm using hidepid=2 to mount /proc, so users can't see any but their own processes. A particular binary I want to use has been restricted to rwx--x--x permissions, so only its owner (root) can read it ...
-1
votes
4answers
99 views

How to grep AND pattern with pipe

I wrote a piece of script similar to something below: srvc_location=`ps -ef| grep '${sandbox}.*pset' | head 1 | awk {print $9}` echo "SERVICE LOC : "$srvc_location But strangely this $srvc_location ...
1
vote
1answer
62 views

Figure out the PID of exact node.js application

Here is an output of my ps aux: ps aux | grep "node" root 2501 0.0 3.4 720400 68512 ? Sl 16:09 0:03 node /etc/skbx/host/skbx.js 8081 tula13 8082 8084 8085 10.8.0.6 root 20586 ...
1
vote
2answers
1k views

View full commands in ps output

When running ps with the -f option in PuTTY (to see the command corresponding to each process), lines which are longer than the terminal width are not fully visible (they are not wrapped on multiple ...
0
votes
2answers
65 views

What is the command in linux, or a utility to know the current comand status (process status)

For example when I write telnet abc.wtf the telnet session begins saying trying to connect so and so IP, but is there a command that I can type in and know what is the current process happening to ...
0
votes
1answer
130 views

List process by name excluding grep [duplicate]

I am trying to list all the ffmpeg processes that are currently running on Debian machine (Ubuntu 15). I use the following command: ps aux | grep 'ffmpeg' If only one ffmpeg process is running, I ...
3
votes
2answers
255 views

process Count of each user in ps aux command

How can i create a script to count process run by each user in ps aux. I used this ps aux | awk '{print $1}' | grep root | wc -l but it lists count of root user only . I want to list number of ...
2
votes
1answer
95 views

Filtering and extracting PIDs as space-separated list from ps using sed

I want to filter and format the output of ps -ax -o pid,command, but not sure what pipe to use for it. I want to filter those lines matching a fixed string at a fixed position, just keep the pids for ...
0
votes
2answers
40 views

Which tool can be used to configure the CPU priority of a process?

I know that you can use nice to re assign priorities of processes but which tool can be used to configure the CPU priority of a process ?
0
votes
2answers
106 views

defunct process - is it always a child process?

reading on what is a defunct process says that it is a child process which when it terminates/end is not properly handled/killed by its parent. but viewing on the below output servera> ps -ef | ...
1
vote
1answer
49 views

Why are arguments of a command altered when viewed by ps?

When I run my favorite app, why the arguments look different when viewed by ps? $ redshift -l 12.94:43.75 2>/dev/null 1>&2 & [1] 8637 $ ps -o cmd= -C redshift redshift -l 12.94 43.75 ...
1
vote
1answer
93 views

Killing PGIDs but proceses are respawning, how do I make it persistent?

I ran ps aux --forest -j to see parent and child processes. Here is an example: root 3744 3744 3744 0.0 0.2 77084 4160 ? Ss 09:34 0:00 /usr/sbin/cupsd -f lp 3747 3747 ...
1
vote
1answer
74 views

Is it better/preferred to kill all child processes by using PPID or PGID?

I need the ability to kill all child processes running under a particular parent. What would be the better option to do this? Using PPID or PGID? Something like this: pkill -TERM -P Would kill ...
1
vote
2answers
820 views

Why I can not use all the 100% potential of CPU?

I am using my computer clusters to run a MD C program but I can not use full potential of those clusters. But the this node have 16 CPUs and I also only give 15 jobs for those CPUs. But I can not ...
2
votes
0answers
31 views

Restrict a user from viewing other user's processes [duplicate]

Suppose there are two users : user1 & user2. Now we know that if I give top -u user1, I can see only the process respective to user1. But if I do top -u user2, I can see all the process running ...
0
votes
2answers
62 views

How to get PPID with PS using BSD options

I'm looking for a ps string that will give me all the output headers of "ps aux" but with the PPID. So far, I can only get the PPID column using ps -ef. I have tried numerous combinations but have ...