ps is a command for printing information about running processes

learn more… | top users | synonyms

5
votes
3answers
28 views

Is there any risk of a race condition when runing ps?

I'm starting a long-running process (in Java, on the off-chance that's relevant) and would like to then capture its PID via ps. I'm essentially doing this: Process longRunningProcess = new ...
0
votes
0answers
15 views

Is High Virtual Memory usage a problem or may cause problems?

In our server, we have a python based code that (simply) listen ports. The amount of Virtual Memory it uses is increased greatly with time Like: USER PID %CPU %MEM VSZ RSS TTY ...
1
vote
0answers
28 views

ps command not working with -p option on solaris10 [on hold]

I am executing following command on solaris 10: ps -o pid,sid -p "procid" It is not listing the output for pid provided, instead it lists all process ids running with their corresponding session ...
0
votes
1answer
34 views

Substantial portion of memory used is not accounted for by user processes

I recently installed a copy of Ubuntu Server 14.04.2 LTS on a cluster. All appears to be working fine, but a large portion (around half) of our total available RAM is being used. I.e., when I run ...
6
votes
2answers
856 views

Format cputime for ps

I'm trying to write a script that can monitor a process's CPU usage over an interval (to create a graph). So far, this is the command I'm using ps -p $PROCID -o cputime,etimes My only concern is ...
3
votes
1answer
1k 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
0answers
49 views

Fedora 21: Getting “libprocps.so.1: cannot open shared object file: No such file or directory” on ps

I have Fedora 21, which is a fedup from Fedora 20. My problem is that whenever I am using ps commaand, I am getting /usr/bin/dpkgd/ps: error while loading shared libraries: libprocps.so.1: cannot ...
17
votes
7answers
60k views

Show top five CPU consuming processes with `ps`

How to show top five CPU consuming processes with ps?
23
votes
2answers
42k views

What does aux mean in `ps aux`?

ps aux seems to conveniently list all processes and their status and resource usage (Linux/BSD/MacOS), however I cannot comprehend the meaning of parameter aux using man ps. What does aux mean?
1
vote
0answers
38 views

Create tree of processes

I'm implementing pstree as an assignment, and I would like to create test tree of processes, but I'm struggling to do so. I tried to do something like this to create tree of background processes ...
4
votes
3answers
5k views

How is it possible to sort ps command's CPU field?

I'm trying to make a small command that will find the processes that use the most CPU power. Firstly, I use ps aux > file.txt and then cut -c 16-20 file.txt | sort -n | tail -5. The result I get ...
0
votes
1answer
499 views

Very large values for utime and stime for foo. Is foo still running?

I am running a program foo It has been running for close to 30 days now (even more) Until around 10 days ago (I cannot be very exact) it used 100% of one cpu on my dual core laptop (it was at the ...
8
votes
2answers
19k views

ps switches to display PID, PPID, PGID, and SID collectively

I tried ps with different kinds of switches e.g. -A, aux, ef, and so forth but I cannot seem to find the right combination of switches that will tell me the Process ID (PID), Parent Process ID (PPID), ...
0
votes
1answer
48 views

sorting ps output by CPU time on linux

I want to sort ps output by process CPU time ("TIME" column). I've tried: ps -aux --sort cputime | tail but it doesn't sort by cpu time. I'm running with: ps --version procps version 3.2.7 ...
6
votes
1answer
7k views

Elegantly get list of children processes

I would like to get a list of all the processes whose parent is $pid. This is the simplest way I've come up with: pstree -p $pid | tr "\n" " " |sed "s/[^0-9]/ /g" |sed "s/\s\s*/ /g" Is there any ...
1
vote
1answer
52 views

How to start (or find) a process with RUID different from EUID?

Inspired by one of the previously answered questions, I tried executing a program by a user who was not its owner -- and the process's RUID and EUID remained the same. (Unless I read the answer wrong ...
1
vote
1answer
37 views

process id and command

I want to write the process id and command of all processes with some name and from some user (for example root and init). What should I do? ps -f -u root -C init or ps -f -U root -C init ...
2
votes
3answers
669 views

Format ps output without whitespace

I have the following ps command to get particular properties of all the running processes along with some properties: ps --no-headers -exo "uname,ppid,pid,etime,%cpu,%mem,args" I wish to have it ...
1
vote
2answers
30 views

Asymmetric ESTABLISHED session in netstat

On the first host, root@xxx:~# netstat -natup | grep xxx tcp 0 0 10.2.5.3:40740 xxx:10051 ESTABLISHED 1482/zabbix_proxy: we can see that a connection has been established with ...
2
votes
1answer
1k views

How is it that I can attach strace to a process that isn't in the output of ps?

I'm trying to debug why our integration tests are taking so long and it looks like they're hanging part way through. I logged onto our test service and saw the following behaviour: root@colossus:~# ...
1
vote
1answer
44 views

Disowned “Stopped” job process still appears in process table

I want to know why after disowning the stopped process, it is still appearing the process table PING www.google.com (74.125.130.106) 56(84) bytes of data. 64 bytes from 74.125.130.106: icmp_seq=1 ...
5
votes
2answers
9k views

Linux : See CPU usage by a process for the last second

vmstat 1 Above will print virtual memory statistics each seconds. It will also show the CPU utilization for last second. I have a web server at hand which runs httpd and MySQL. I need to find how ...
2
votes
1answer
107 views

Using ps and watch to observe parent and child process

I got a parent and a child process running, I know their IDs. How do I utilize 'ps' and 'watch' to filter them out, so that I can see their used CPU times? I tried 'watch ps -u USERNAME', but as you ...
5
votes
3answers
5k 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
1answer
50 views

Cron start script twice

I have a backup script which sends my snapshots to a off-site location. 0 0 * * * /root/backup/backup_incremental >> /root/backup/test.log For some reason my PID file which should stop the ...
49
votes
4answers
6k views

In what order do piped commands run?

I've never really thought about how the shell actually executes piped commands. I've always been told that the "stdout of one program gets piped into the stdin of another," as a way of thinking about ...
5
votes
4answers
425 views

list graphical processes from terminal

Do no confuse the question here with how to list processes graphically, that is not what I am asking. In the Terminal, how can i see which processes have a GUI? as in things like firefox, vlc, ...
2
votes
1answer
104 views

monitor multiple pids with top

I want to monitor memory usage for several processes and came up with a command like this: ps aux |grep -e postgres -e unicorn -e nginx|cut -d' ' -f2|for i in $(xargs); do echo $i; done 16112 16113 ...
0
votes
3answers
80 views

grep randomly appearing and disappearing in ps aux (ps aux | grep python) [duplicate]

This isn't an actual problem - but more of a curious question, when I run while true; do ps aux | grep abc; echo done; done I get the following: user 29733 0.0 0.0 11748 924 pts/1 R+ ...
0
votes
2answers
114 views

Meaning of the pstree output

-bash-3.2$ pstree 27108 Script.sh---java---15*[{java}] What does this 15* mean here, also any meanings defined for [] & {} in the context of command?
-3
votes
2answers
793 views

understanding ps -ef output

root@he:/home/he# ps -ef|grep init root 1 0 0 08:40 ? 00:00:02 /sbin/init root 3557 3545 0 10:09 pts/0 00:00:00 grep --color=auto init What are various columns ...
37
votes
5answers
79k views

How can I get a full process list in solaris, without truncated lines?

Is there a way to generate a full process listing in solaris, without truncated lines? I've tried the ps command, with the following arguments: -f Generates a full listing. ...
1
vote
3answers
105 views

Inetd and Xinetd: which is running?

I'm studying for the first LPIC exam. In a quiz, I've found this question: How can you tell whether your system is using inetd or xinetd as a super server? And the right answer should be: ...
16
votes
6answers
5k views

Can ps display only non kernel processes on Linux?

How can I ask ps to display only user processes and not kernel threads? See this question to see what I mean...
0
votes
2answers
125 views

ps output / pipeline execution order

I run ps aux | grep somethinghere. The output shows the grep somethinghere as a running process. My question is, shouldn't ps aux finish first, then grep somethinghere run on its output? Maybe there ...
1
vote
0answers
43 views

ps shows my mkdir command with a space where I had a slash

I have a script that I ran which seemed to hang during a mkdir command. The command is of the form: mkdir -p /a/b/c/d However, in the ps results, I see: mkdir -p /a/b c/d What could cause this ...
0
votes
1answer
48 views

Is there a way to see which user is logged into the system and has switched with “su”?

There are many person that may have access to the system and use a common user with more grants. How can I see which user is running a command? is there a way to use "ps" for that?
84
votes
10answers
21k 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 ...
1
vote
1answer
99 views

Count the total number of sub-processes (recursively) spawned by a command

How do find the total number of child processes (recursively) spawned by a script? For profiling purposes, it is sometimes important to count the generated sub-processes of command, script, etc. ...
22
votes
2answers
5k views

When was a process started

To know when was a process started, my first guess was to check the time when /proc/<pid>/cmdline was written/modified the last time. ps also shows a START field. I thought both of these ...
3
votes
2answers
178 views

Select lines starting with specific numbers

I have to show the PID, PPID and STATUS of the procceses on the system, but only the ones which PID starts with numbers in the range 5-8. So i tried something like this... ps xao pid,ppid,s | grep ' ...
2
votes
1answer
4k 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 ...
0
votes
2answers
299 views

how to print ps header when using pipe in linux [duplicate]

how to print ps header when using pipe in linux this normal ps output $ ps -ef UID PID PPID C STIME TTY TIME CMD root 1 0 0 17:00 ? 00:00:02 ...
4
votes
1answer
130 views

How does ps get the executable of processes of other users?

When running as non-root, if I try to use readlink(2) on a /proc/<pid>/exe for a process not owned by me I get a permission error. So how then does ps with the -f option, which isn't setuid ...
3
votes
1answer
2k views

Process history in Unix/Linux systems

I know that ps -efl shows running processes on *nix systems. I would like to check history of the (past) processes that have been run on a particular machine, preferably with all the information ps ...
3
votes
2answers
3k views

What does a “[1]+ Exit 1” response mean?

I ran this command to try and get my python program to run in the background and let me exit the SSH connection I am using: nohup python files.py >> files.log & I then check ps to check ...
3
votes
2answers
5k views

How to find out total memory resource usage with ps?

With ps command I can find out how much memory each program uses: ps -u mertnuhoglu -o pcpu,rss,pid,command Is it possible to find out the sums of each type of resource usage as well, easily?
3
votes
2answers
770 views

Sorting the output of `ps`

I am trying to understand why ps does not behave the way I expect it to. From the man pages, the following command should display ppid and lstart, with items sorted by lstart order. However when I run ...
1
vote
1answer
47 views

In which directory is node running?

In trying to figure out how some application that listens on port 8088 is running, I see that it has PID 15020: $ netstat -ntulp Proto Recv-Q Send-Q Local Address Foreign Address ...
1
vote
1answer
100 views

Why is my second tmux session not shown in ps aux or htop but in tmux list-sessions it is?

I start two new tmux sessions, the session name is variably build from a timestamp. (the commands create a new, detached tmux session, which first changes the directory, lists the content and then ...