A process is an instance of a computer program that is being executed.
34
votes
6answers
10k views
How can I disown a running process and associate it to a new screen shell?
I have a running program on a SSH shell. I want to pause it and be able to unpause its execution when I come back.
One way I thought of doing that was to transfer its ownership to a screen shell, ...
38
votes
3answers
16k views
How do I read from /proc/$pid/mem under Linux?
The Linux proc(5) man page tells me that /proc/$pid/mem “can be used to access the pages of a process's memory”. But a straightforward attempt to use it only gives me
$ cat /proc/$$/mem ...
29
votes
4answers
13k views
How can I close a terminal without killing the command running in it?
Sometimes I want to start a process and forget about it. If I start it from the command line, like this:
redshift
I can't close the terminal, or it will kill the process. Can I run a command in ...
76
votes
11answers
33k views
What if 'kill -9' does not work?
I have a process I can't kill with kill -9 <pid>. What's the problem in such a case, especially since I am the owner of that process. I thought nothing could evade that kill option.
43
votes
6answers
10k views
Keep SSH Sessions running after disconnection
I sometimes have long running processes that I want to kick off before going home, so I create a SSH session to the server to start the process, but then I want to close my laptop and go home and ...
16
votes
4answers
2k views
Measuring RAM usage of a program
time is a brilliant command if you want to figure out how much CPU time a given command takes.
I am looking for something similar that can measure the max RAM usage of the program and any children. ...
7
votes
4answers
2k views
What process created this X11 window?
Given an X11 window ID, is there a way to find the ID of the process that created it?
Of course this isn't always possible, for example if the window came over a TCP connection. For that case I'd ...
5
votes
2answers
1k views
Hide processes from other users based on groups (under Linux)?
Is it possible to configure process hiding for certain user groups under a linux system?
For example: Users from group X should not see processes owned by users from group Y in ps/top or under /proc.
...
19
votes
3answers
30k 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 commmand, with the following arguments:
-f Generates a full listing. ...
17
votes
4answers
4k views
Determine which process is creating a file
Given file path, how can I determine which process creates it (and/or reads/writes to it)?
13
votes
3answers
1k views
How can I set the processor affinity of a process on Linux?
The question is all in the title: How can I set the processor affinity of a process on Linux?
15
votes
4answers
2k views
What happens to the output of a process that has been disowned and lost its terminal?
If I close the virtual terminal, where some process was started, does the output just go straight to /dev/null, or can it pollute memory somehow?
Can I anyhow grab the output to continue reading it at ...
1
vote
2answers
209 views
Is there a log of past threads that are now closed?
Sometimes, I have a rogue Java process which takes up 100% of my CPU and makes it jump about 30C in temperature (usually resulting in a crash if not killed).
Problem is, I can never really identify ...
3
votes
1answer
861 views
I don't want other users see my processes in ps aux. I have root. It's Debian. How to use grsec?
I installed 'linux-patch-grsecurity2' and it has some sort of interface.
~$ sudo gradm2
gradm 2.1.14
grsecurity administration program
Usage: gradm [option] ...
Examples:
gradm -P
...
15
votes
4answers
10k views
How to check how long a process has been running?
I would like to avoid doing this by launching the process from a monitoring app.
13
votes
3answers
15k views
How to monitor CPU/memory usage of a single process?
I would like to monitor one process's memory / cpu usage in real time. Similar to top but targeted at only one process, preferably with a history graph of some sort.
10
votes
4answers
13k views
Is there a way to see details of all the threads that a process has in Linux?
For Windows, I think Process Explorer shows you all the threads under a process.
Is there a similar command line utility for Linux that can show me details about all the threads a particular process ...
10
votes
3answers
2k views
Can I limit a process to a certain amount of time / CPU cycles?
We have a script which runs on our web servers, triggered by customer action, which initiates a unix process to generate some cache files. Because this process acts upon files supplied by our ...
8
votes
2answers
3k views
Linux: Writing a watchdog to monitor multiple processes
A few years ago, a coworker came up with an elegant solution for a watchdog program. The program ran on Windows and used Windows Event objects to monitor the process handles (PID’s) of several ...
5
votes
4answers
1k views
Finding the ID of a process and killing it
When ever I need to kill a background process I do ps -e | grep <process_name>
Which prints something like this 1766 ? 00:00:13 conky , Then I use the process ID to kill it like so kill 1766 .
...
5
votes
3answers
2k views
How to read environment variables of a process
Linux's /proc/<pid>/environ does not update (as I understand it, the file contain the initial environment of the process).
How can I read a process's current environment?
3
votes
2answers
937 views
How to check how long a process ran after it finished?
Currently I'm using the following to check how long a process is actually running:
ps -eo uid,pid,etime | egrep '^ *MY_ID' | egrep 'PID_OF_PROCESS'
And that outputs the following:
MY_ID ...
2
votes
1answer
428 views
Check for process already running in webfaction?
I use Django framework on webfaction and have 5 different cron jobs. One of them lasts much longer than others and sometimes gets stuck (30-120 seconds or more).
I have already set that cron job to ...
8
votes
1answer
4k views
Getting information about a process' memory usage from /proc/pid/smaps
For a given process in /proc/<pid>/smaps, for a given mapping entry what are:
Shared_Clean
Shared_Dirty
Private_Clean
Private_Dirty
Is Shared_Clean + Shared_Dirty the amount of memory that ...
18
votes
4answers
738 views
What's the difference between running a program as a daemon and forking it into background with '&'?
What are the practical differences from a sysadmin point of view when deploying services on a unix based system?
13
votes
5answers
4k views
How can I close a terminal without killing its children (without running `screen` first)?
sometimes I run an app in the gnome-terminal, but then I suddenly have to restart gnome or something. I guess the answer to the question is also useful then I want to disconnect from SSH where ...
18
votes
3answers
4k views
What are “session leaders” in `ps`?
What are session leaders, as in ps -d which selects all processes except session leaders?
23
votes
2answers
2k views
Why is the default process creation mechanism fork?
The UNIX system call for process creation, fork(), creates a child process by copying the parent process. My understanding is that this is almost always followed by a call to exec() to replace the ...
7
votes
1answer
2k views
How to suspend and resume proccesses like bash does
this question is a follow-up to: How to suspend and resume proccesses
I have started firefox from a bash session in gnome-terminal.
The proccess tree looks like this:
$ ps -e -o pid,ppid,cmd -H
...
12
votes
5answers
3k views
Is there a way to limit the amount of memory a particular process can use in Unix?
I need to test a process for memory management.
I do not have the source, so I need to do all the testing from the OS side.
I want to be able to say something like limitmemory 400k -p <pid>
...
6
votes
3answers
485 views
Running continuous jobs remotely
I'm new to Linux, and I'm probably asking a fairly basic question. How do I run a continuous program on Linux?
Basically, I have a program that will continuously check for content on a website. This ...
3
votes
1answer
379 views
Difference between process group and job?
What's the difference between a process group and a job? If I type pr * | lpr then is it both a process group as well a job?
What exactly is the difference between a process group ID and a job ID?
...
15
votes
2answers
2k views
What is the difference between a job and a process?
What is the difference between a "job" and a "process"?
6
votes
2answers
602 views
Is it possible to transfer a running process to your terminal? [duplicate]
Possible Duplicate:
How can I pause up a running process over ssh, disown it, associate it to a new screen shell and unpause it?
It is fairly easy to disown a process, or make it run ...
1
vote
1answer
224 views
What process created this window with no PID associated? [duplicate]
Possible Duplicate:
What process created this X11 window?
I need to kill a process that spawned a window which seems to have no PID associated with it. At least that is what xdotool says:
...
10
votes
4answers
537 views
What is the difference between running a executable just by name and by appending a dot /slash before it?
This is the output from ls -all command :
-rwxr----- 1 subhrcho dba 3600 Nov 13 17:26 jdev
-rw-r----- 1 subhrcho dba 1566 Nov 13 17:26 jdev-Darwin.conf
-rw-r----- 1 subhrcho dba 347 Mar 6 2009 ...
5
votes
1answer
206 views
Why is the following command killing a system?
Anyone understand the following code , running in bash ?
:(){ :|:& };:
It seems to be a "fork" bomb on Linux.
5
votes
3answers
1k views
nohup vs. Screen
In the past, I've used nohup to run big background jobs, but I've noticed that a lot of people use Screen in this context. Does Screen provide some kind of functional advantage that I am unaware of, ...
4
votes
6answers
887 views
Kill many instances of a running process with one command
This is one of the questions that has troubled me often. Suppose I have thousand or more instances of any process(for e.g. say the process vi) running. How do I kill them all in one single shot/one ...
2
votes
2answers
317 views
I need help with a cronjob to watch for runaway processes and kill them
I have an interesting situation, I have a runaway ruby process - I know exactly how I trigger it.
Point is, it got me thinking about runaway processes (CPU usage or memory usage).
How would one ...
1
vote
2answers
203 views
Discrepancy between reported used memory and sum of application memory usage
I'm running a desktop system that quite regularly suffers from lack of memory, this prompted me to investigate what causes the issue in the first place.
Problem is, there's no single process that ...
4
votes
4answers
245 views
why new pid is smaller than the old ones?
Is there any chance the new process's pid is smaller than the existed ones ?
I have a daemon process which will restart when be killed, I recorded the pids,
and found that the pid first came smaller, ...
4
votes
2answers
8k views
How can I see what processes are running?
I use Ubuntu Server 10.10 and I would like to see what processes are running. I know that PostgreSQL is running on my machine but I can not see it with the top or ps commands, so I assume that they ...
3
votes
3answers
34 views
How can you change the process name of Wing IDE from python to something more descriptive
In my process list under Ubuntu (using top/System Monitor) one of the largest memory hogs (200+Mb) was python. I searched a bit for one of my programs to be the cause until I realised this was my ...
3
votes
0answers
80 views
Elegantly get list of descendant processes
I would like to get a list of all the processes that descend (e.g. children, grand-children, etc) from $pid. This is the simplest way I've come up with:
pstree -p $pid | tr "\n" " " |sed "s/[^0-9]/ ...
3
votes
5answers
2k views
Drop Process Privileges
I have a process that gets started by a damon running as root, now I want to "downgrade" this process's privileges to those of your average user. Is this possible? If yes how?
PS: Running unix on a ...
2
votes
1answer
3k views
What does this process STAT indicates?
If you check the STAT column in above image you will see Ss S S< SN and R+
What does this indicates ? Process states.
If yes,Then what is the significance of 'Ss S< SN and R+'?
1
vote
2answers
655 views
How to pass data outside process for zenity progress?
Usually this would be a question about how to pass data from a subprocess to a main process, but maybe zenity has some extra quirks so please focus on zenity.
Example:
#!/bin/sh
(
echo "10" ; sleep ...
1
vote
2answers
101 views
Terminal command (called not from SU) that would restrict process from writting to all directories but one?
We have an app testApp. We have a folder called notRestricted in the directory where we run app from. We want to limit access of the app to file system so that app could write only to that folder (we ...