ps is a command for printing information about running processes

learn more… | top users | synonyms

2
votes
2answers
27 views

Hide arguments of commands in ps

I run an application on a linux server, and when I run the application I supply the password as a command line, like this: ./myapplication --smtp-password mypassword In our application, we didn't ...
1
vote
0answers
10 views

Why total swaps and page faults/reclaims is empty in ps?

I'm running the following command: sudo ps -axo nswap,majflt,minflt,command | sort -nr | head which suppose to print total swaps in/out, total page faults and reclaims. But for given >400 ...
0
votes
1answer
36 views

difference between args in ps command

I'm new to bash and Linux and have a question. My problem is that I want to print a process name by its pid. I've googled and found few ways to do it: ps -p <PID> -o cmd ps -p <PID> -o ...
3
votes
2answers
94 views

Solaris ps aux comand specific output. Why for grep need use ww parameter?

I'm starting to use Oracle Solaris 11.2 SPARC. In Linux, I can write ps aux | grep *some_data* But doesn't show any result on Solaris. Instead I need to say ps auxww | grep *some_data* I had ...
9
votes
3answers
908 views

How to kill multiple processes

to find the PID of the process to kill use : pgrep <process command> I then use the kill command to kill the PID returned by pgrep <process command> kill <PID> Can these ...
0
votes
3answers
194 views

Check for process and kill if running

I am trying to find if a process is running or not, and if it is runing then I want to call a script or print something. I tried with the below few ways, but it gives me syntax error or command not ...
1
vote
4answers
51 views

Function of second grep in `ps | grep -v | grep`

ps aux | grep firefox Lists all processes having the string "firefox" ps aux | grep -v firefox Lists all the processes without the string "firefox" ps aux | grep -v grep | grep firefox ? ...
-1
votes
2answers
64 views

ps command not working properly? [closed]

I am using a Debian Virtual Box with the Bash shell and I am trying to use the ps command with the -c switch to find an ID of a process by searching its name. This is what I write: ps -c processname ...
6
votes
1answer
93 views

What does '?' represent under TTY

If you run ps in your terminal, you may see something like the following: What is ?? I'm ssh'ing into a Linux server, so I assume that it's just the sshd as it says under CMD, but I'm curious what ...
4
votes
3answers
181 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. ...
1
vote
2answers
62 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
18 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
89 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
71 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
46 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
28 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
46 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
54 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
56 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
42 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
32 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
82 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
26 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
56 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
30 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
83 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
70 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
45 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
766 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
65 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
452 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
84 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
39 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
108 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
106 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
91 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
37 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
71 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
107 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
93 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
41 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
41 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
110 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
121 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
617 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
107 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
51 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
81 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
141 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
66 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 ...