Questions tagged [process]

A process is an instance of a computer program that is being executed.

Filter by
Sorted by
Tagged with
57
votes
4answers
88k views

How can I pause/resume rsync

How can I pause an rsync that's running? First time I did Ctrl+C to kill it and used the -P flag to run again. Is this prone to corrupt the current file transfer? Second time I simply put MacOS to ...
57
votes
3answers
14k views

Why can't I crash my system with a fork bomb?

Recently I've been digging up information about processes in GNU/Linux and I met the infamous fork bomb : :(){ : | :& }; : Theoretically, it is supposed to duplicate itself infinitely until the ...
56
votes
6answers
282k views

How to check which process is using most memory

When I check free in one of Prod server it showing 70% of memory is being used: total used free shared buffers cached Mem: 164923172 141171860 23751312 ...
56
votes
1answer
94k 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+'?
54
votes
2answers
155k views

'ps' arguments 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), ...
54
votes
4answers
56k views

What is the maximum value of the Process ID?

What is the maximum value of the Process ID? Also, is it possible to change a Process ID?
54
votes
1answer
62k 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 is ...
53
votes
4answers
45k views

What is the difference between a job and a process?

What is the difference between a "job" and a "process"?
51
votes
5answers
64k 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?
51
votes
2answers
6k 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 ...
50
votes
8answers
56k views

Is there a program that can send me a notification e-mail when a process finishes?

I am a computational scientist, and I run a lot of lengthy calculations on Linux. Specifically, I run molecular dynamics (MD) simulations using the GROMACS package. These simulations can take days ...
50
votes
4answers
21k 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?
49
votes
6answers
40k views

Which process is `/proc/self/` for?

https://www.centos.org/docs/5/html/5.2/Deployment_Guide/s3-proc-self.html says The /proc/self/ directory is a link to the currently running process. There are always multiple processes running ...
49
votes
5answers
125k views

How to know where a program is stuck in linux?

I am running the following command on my ubuntu server root@slot13:~# lxc-stop --name pavan --logfile=test1.txt --logpriority=trace It seems to hang indefinitely. Whenever this happened on AIX, I ...
49
votes
5answers
34k 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. ...
49
votes
4answers
16k views

Is there any UNIX variant on which a child process dies with its parent?

I have been studying the Linux kernel behaviour for quite some time now, and it's always been clear to me that: When a process dies, all its children are given back to the init process (PID 1) ...
49
votes
1answer
42k views

How do I monitor opened files of a process in realtime?

I know I can view the open files of a process using lsof at that moment in time on my Linux machine. However, a process can open, alter and close a file so quickly that I won't be able to see it when ...
48
votes
5answers
85k views

How to send keystrokes (F5) from terminal to a GUI program?

I'm using a Raspberry Pi in combination with Chromium (kiosk mode) to show up some stats. The Pi doesn't have a connected keyboard so I searched for a solution to send keystrokes from the terminal to ...
48
votes
2answers
31k views

Why does process substitution result in a file called /dev/fd/63 which is a pipe?

I am trying to understand named pipes in the context of this particular example. I type <(ls -l) in my terminal and get the output as, bash: /dev/fd/63: Permission denied. If I type cat <(ls -...
47
votes
9answers
28k 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...
45
votes
4answers
37k 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, ...
45
votes
1answer
9k views

What is a “subreaper” process?

The word "subreaper" is used in some answers. Searching Google also turn up entries where the word is "just used". How can I understand what a "subreaper" is?
41
votes
6answers
9k views

Does pressing ctrl-c several times make the running program close more quickly?

I often start to read a huge file and then want to quit after a while, but there is a lag from pressing Ctrl+C to the program stops. Is there a chance of shortening the lag by pressing the Ctrl+C key ...
40
votes
6answers
12k views

Is there a way to pause a running process on Linux systems and resume later?

I have to copy files on a machine. And the data is immensely large. Now servers need to serve normally, and there are usually a particular range of busy hours on those. So is there a way to run such ...
40
votes
9answers
12k views

How can I kill a process and be sure the PID hasn't been reused

Suppose, for example, you have a shell script similar to: longrunningthing & p=$! echo Killing longrunningthing on PID $p in 24 hours sleep 86400 echo Time up! kill $p Should do the trick, ...
40
votes
7answers
54k views

Is there a way to limit the amount of memory a particular process can use in Unix? [duplicate]

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> Is ...
39
votes
4answers
37k views

Is there a top-like command that shows the network bandwidths and file accesses of running processes

For example, we'd like to see: PROCESS IF TX RX FILE(regular) R/W prog1 eth0 200kB/s 12kB/s -- -- wlan0 12kB/s 100kB/s -- ...
38
votes
4answers
44k views

How do I tell a script to wait for a process to start accepting requests on a port?

I need a command that will wait for a process to start accepting requests on a specific port. Is there something in linux that does that? while (checkAlive -host localhost -port 13000 == false) ...
37
votes
8answers
23k views

How to track newly created processes in Linux?

I know that with ps I can see the list or tree of the current processes running in the system. But what I want to achieve is to "follow" the new processes that are created when using the computer. As ...
37
votes
2answers
19k views

What happens when we type a simple command on shell? [duplicate]

I have a simple question regarding the execution of a simple command. As per my understanding, when we type a command such as ls in an interactive shell, Shell interprets the command. Shell creates ...
37
votes
1answer
9k views

What exactly are “Voluntary context switches”?

I got a binary file and I'm supposed to crack its password (homework). There was also a function given (a function which is a part of the binary file). That function showed that the input string was ...
36
votes
7answers
172k views

Fix “firefox is already running” issue in Linux

I am trying to open Firefox in CentOS, but I'm getting the following message: Firefox is already running but is not responding and Firefox doesn't open. I tried this in command line: kill ...
36
votes
7answers
41k 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 ...
36
votes
4answers
12k views

How can I set the processor affinity of a process on Linux?

How can I set the processor affinity of a process on Linux?
35
votes
4answers
73k views

Show network connections of a process

Is there a way to show the connections of a process? Something like that: show PID in which show is a command to do this, and PID is the ID of the process. The output that I want is composed of all ...
35
votes
4answers
88k views

Find out what processes are writing to hard drive

On my Lenovo T400 and Ubuntu, the light for hard drive writing keeps flashing. I was wondering if in Linux it is possible to find out what processes are doing I/O to the hard drive? Just like by top, ...
35
votes
4answers
16k views

tmux session lost in unknown pts, cause and possible solution?

I was trying to re-attach to a long-running tmux session to check up on a python web-application. However tmux attach claims that there is no running session, and ps shows a tmux process (first line), ...
35
votes
1answer
19k views

How to ensure exclusive CPU availability for a running process?

At first, the question seems to be a little bit silly/confusing as the OS does the job of managing process execution. However, I want to measure how much some processes are CPU/IO-bound and I feel ...
34
votes
5answers
193k views

How to find which Process is causing High CPU usage

Is there any way to find out from terminal which process is causing high CPU Usage ? It would also be useful to order processes in descending order of cpu Usage
34
votes
3answers
7k views

How can I see the exact command line being executed inside some bash instance?

I have a long running bash instance (inside a screen session) that is executing a complex set of commands inside a loop (with each loop doing pipes, redirects, etc). The long command line was ...
34
votes
2answers
85k views

In bash script, how to capture stdout line by line

In a bash script, I would like to capture the standard output of a long command line by line, so that they can be analysed and reported while initial command is still running. This is the complicated ...
34
votes
3answers
58k views

Where can I see a list of kernel killed processes?

Is there some way I can check which of my processes the kernel has killed? Sometimes I log onto my server and find that something that should've run all night just stopped 8 hours in and I'm unsure if ...
33
votes
2answers
24k 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 ...
33
votes
2answers
51k views

How to know reason of a process going to sleep state and wake it up?

When I do 'top' , I see my perl script process in 'S' state. Is there a way to know, what is making this perl process go in sleep state and ways to wake it up? Any way to debug to give more insights ...
33
votes
1answer
9k views

How does systemd survive a kill -9?

Between the recent "Why does 'kill -9 0' end my console session" and "How to get a kernel panic" questions, I got a bur under my saddle and tried kill -9 1 on a mostly up-to-date Arch linux laptop. I ...
33
votes
2answers
12k views

How to set per process swapiness for linux?

/proc/sys/vm/swappiness is nice, but I want a knob that is per process like /proc/$PID/oom_adj. So that I can make certain processes less likely than others to have any of their pages swapped out. ...
32
votes
5answers
34k views

How to find out namespace of a particular process?

I already asked a question about how to list all namespaces in Linux, but there wasn't any correct and exact answers, so I want to find out a method which can help me to find out the namespace of PID ...
32
votes
2answers
17k views

What causes various signals to be sent?

I sometimes get a little confused by all of the signals that a process can receive. As I understand it, a process has a default handler (signal disposition) for each of these signals, but it can ...
31
votes
3answers
14k views

Do functions run as subprocesses in Bash?

In Advanced Bash-Scripting Guide, in example 27-4, 7-th line from the bottom, I've read this: A function runs as a sub-process. I did a test in Bash, and it seems that the above statement is wrong....
31
votes
7answers
77k views

How to see how many context switches a process makes?

I want to see if my process makes a lot of context switches. I also want to see how manpulating task groups affects the number of context switches.

1
2
3 4 5
48