Questions tagged [process]
This tag is about operating system processes. It may also refer to a specific construct on a given platform, e.g., the System.Diagnostics.Process class for .NET
process
18,315
questions
3035
votes
40
answers
4.4m
views
Find (and kill) process locking port 3000 on Mac [closed]
How do I find (and kill) processes that listen to/use my TCP ports? I'm on macOS.
Sometimes, after a crash or some bug, my Rails app is locking port 3000. I can't find it using ps -ef...
When running
...
2031
votes
35
answers
1.4m
views
What is the difference between a process and a thread?
What is the technical difference between a process and a thread?
I get the feeling a word like 'process' is overused and there are also hardware and software threads. How about light-weight processes ...
989
votes
7
answers
1.1m
views
How do I get the application exit code from a Windows command line?
I am running a program and want to see what its return code is (since it returns different codes based on different errors).
I know in Bash I can do this by running
echo $?
What do I do when ...
911
votes
32
answers
1.5m
views
How can I measure the actual memory usage of an application or process?
How do you measure the memory usage of an application or process in Linux?
From the blog article of Understanding memory usage on Linux, ps is not an accurate tool to use for this intent.
Why ps is &...
887
votes
60
answers
1.7m
views
Node / Express: EADDRINUSE, Address already in use - how can I stop the process using the port?
I have a simple server running in node.js using connect:
var server = require('connect').createServer();
//actions...
server.listen(3000);
In my code I have actual route handlers, but that's the ...
819
votes
13
answers
627k
views
What killed my process and why?
My application runs as a background process on Linux. It is currently started at the command line in a Terminal window.
Recently a user was executing the application for a while and it died ...
793
votes
14
answers
145k
views
Xcode process launch failed: Security
I have been developing an app for 1 or 2 weeks now and just yesterday I have updated my iPhone 5S to the iOS 8 GM. Everything worked fine and I could test on my device as well until I deleted the app ...
769
votes
35
answers
789k
views
How to wait in bash for several subprocesses to finish, and return exit code !=0 when any subprocess ends with code !=0?
How to wait in a bash script for several subprocesses spawned from that script to finish, and then return exit code !=0 when any of the subprocesses ends with code !=0?
Simple script:
#!/bin/bash
for ...
662
votes
31
answers
861k
views
How do I run a node.js app as a background service?
Since this post has gotten a lot of attention over the years, I've listed the top solutions per platform at the bottom of this post.
Original post:
I want my node.js server to run in the background, ...
600
votes
13
answers
716k
views
How do I execute a command and get the output of the command within C++ using POSIX?
I am looking for a way to get the output of a command when it is run from within a C++ program. I have looked at using the system() function, but that will just execute a command. Here's an example ...
466
votes
35
answers
443k
views
What's the best way to send a signal to all members of a process group?
I want to kill a whole process tree. What is the best way to do this using any common scripting languages? I am looking for a simple solution.
447
votes
72
answers
497k
views
Visual Studio "Could not copy" .... during build
I keep getting this error during the build of my VS2012 C# project
Error 41 Could not copy "obj\Debug\WeinGartner.WeinCad.exe" to
"bin\Debug\WeinGartner.WeinCad.exe".
Exceeded retry count of 10....
412
votes
11
answers
682k
views
Start a background process in Python
I'm trying to port a shell script to the much more readable python version. The original shell script starts several processes (utilities, monitors, etc.) in the background with "&". How can I ...
384
votes
8
answers
336k
views
How to get the start time of a long-running Linux process?
Is it possible to get the start time of an old running process? It seems that ps will report the date (not the time) if it wasn't started today, and only the year if it wasn't started this year. Is ...
378
votes
10
answers
571k
views
127 Return code from $?
What is the meaning of return value 127 from $? in UNIX.
374
votes
12
answers
219k
views
What is a "thread" (really)?
I have been trying to find a good definition, and get an understanding, of what a thread really is.
It seems that I must be missing something obvious, but every time I read about what a thread is, it'...
344
votes
13
answers
238k
views
What resources are shared between threads?
Recently, I have been asked a question in an interview what's the difference between a process and a thread. Really, I did not know the answer. I thought for a minute and gave a very weird answer.
...
324
votes
12
answers
703k
views
How to pause / sleep thread or process in Android?
I want to make a pause between two lines of code, Let me explain a bit:
-> the user clicks a button (a card in fact) and I show it by changing the background of this button:
thisbutton....
312
votes
20
answers
247k
views
How to prevent a background process from being stopped after closing SSH client in Linux [closed]
I'm working on a Linux machine through SSH (Putty). I need to leave a process running during the night, so I thought I could do that by starting the process in background (with an ampersand at the end ...
294
votes
11
answers
532k
views
How do I capture the output into a variable from an external process in PowerShell?
I'd like to run an external process and capture its command output to a variable in PowerShell. I'm currently using this:
$params = "/verify $pc /domain:hosp.uhhg.org"
start-process "...
284
votes
16
answers
134k
views
Threads vs Processes in Linux [closed]
I've recently heard a few people say that in Linux, it is almost always better to use processes instead of threads, since Linux is very efficient in handling processes, and because there are so many ...
262
votes
11
answers
403k
views
How to check if a process id (PID) exists
In a bash script, I want to do the following (in pseudo-code):
if [ a process exists with $PID ]; then
kill $PID
fi
What's the appropriate expression for the conditional statement?
257
votes
5
answers
169k
views
The difference between fork(), vfork(), exec() and clone()
I was looking to find the difference between these four on Google and I expected there to be a huge amount of information on this, but there really wasn't any solid comparison between the four calls.
...
254
votes
24
answers
224k
views
How to make child process die after parent exits?
Suppose I have a process which spawns exactly one child process. Now when the parent process exits for whatever reason (normally or abnormally, by kill, ^C, assert failure or anything else) I want the ...
245
votes
9
answers
323k
views
Wait until a process ends
I've an application which does
Process.Start()
to start another application 'ABC'. I want to wait till that application ends (process dies) and continue my execution. How can I do it?
There may be ...
223
votes
5
answers
318k
views
Understanding PrimeFaces process/update and JSF f:ajax execute/render attributes
What exactly are process and update in PrimeFaces p:commandXxx components and execute and render in f:ajax tag?
Which works at the time of validation? What does update attribute do rather than ...
218
votes
15
answers
243k
views
Wait for a process to finish
Is there any builtin feature in Bash to wait for a process to finish?
The wait command only allows one to wait for child processes to finish.
I would like to know if there is any way to wait for any ...
213
votes
6
answers
90k
views
What are the differences between the threading and multiprocessing modules?
I am learning how to use the threading and the multiprocessing modules in Python to run certain operations in parallel and speed up my code.
I am finding it hard (maybe because I don't have any ...
212
votes
43
answers
144k
views
Quick-and-dirty way to ensure only one instance of a shell script is running at a time
What's a quick-and-dirty way to make sure that only one instance of a shell script is running at a given time?
211
votes
14
answers
301k
views
Viewing full output of PS command
when I run ps -aux command on my linux server, to which I connected using putty, few processes are too long to fit in my current window width. Is there an alternative?
-- Update --
I am sorry for ...
208
votes
11
answers
287k
views
top -c command in linux to filter processes listed based on processname
top -c
Top lists all the processes, there are good options to filter the processes by username by using the option -u but I am wondering if there is any easy way to filter the processes based on ...
203
votes
15
answers
413k
views
How do I start a process from C#?
How do I start a process, such as launching a URL when the user clicks a button?
201
votes
7
answers
116k
views
module is not defined and process is not defined in eslint in visual studio code
I have installed eslint in my machine and i have used visual studio code
i have certain modules and process to be exported
When i try to use "module" or "process" it shows
it was working fine before.
...
197
votes
23
answers
253k
views
How do I trim a file extension from a String in Java?
What's the most efficient way to trim the suffix in Java, like this:
title part1.txt
title part2.html
=>
title part1
title part2
196
votes
14
answers
315k
views
How can I know if a process is running?
When I get a reference to a System.Diagnostics.Process, how can I know if a process is currently running?
194
votes
4
answers
76k
views
node.js child process - difference between spawn & fork
This might seem like a basic question, but I could not find any documentation :
What is the difference between forking & spawning a node.js process? I have read that forking is a special case of ...
185
votes
16
answers
117k
views
Kill child process when parent process is killed
I'm creating new processes using System.Diagnostics.Process class from my application. I want this processes to be killed when/if my application has crashed. But if I kill my application from Task ...
184
votes
14
answers
219k
views
Get exit code of a background process
I have a command CMD called from my main bourne shell script that takes forever.
I want to modify the script as follows:
Run the command CMD in parallel as a background process (CMD &).
In the ...
183
votes
11
answers
283k
views
How do I get the path of a process in Unix / Linux?
In a Windows environment there is an API to obtain the path which is running a process. Is there something similar in Unix / Linux?
Or is there some other way to do that in these environments?
179
votes
9
answers
257k
views
Kill some processes by .exe file name
How can I kill some active processes by searching for their .exe filenames in C# .NET or C++?
179
votes
31
answers
599k
views
Taskkill /f doesn't kill a process
When I start up an Experimental instance of VS from VS for debugging and stop debugging (sometimes directly from the parent VS), a zombile devenv.exe process remains running which I am unable to kill. ...
178
votes
9
answers
156k
views
How to spawn a process and capture its STDOUT in .NET? [duplicate]
I need to spawn a child process that is a console application, and capture its output.
I wrote up the following code for a method:
string retMessage = String.Empty;
ProcessStartInfo startInfo = new ...
165
votes
11
answers
491k
views
Executing Batch File in C#
I'm trying to execute a batch file in C#, but I'm not getting any luck doing it.
I've found multiple examples on the Internet doing it, but it is not working for me.
public void ExecuteCommand(...
162
votes
25
answers
111k
views
Make sure only a single instance of a program is running
Is there a Pythonic way to have only one instance of a program running?
The only reasonable solution I've come up with is trying to run it as a server on some port, then second program trying to ...
162
votes
9
answers
113k
views
Thread context switch Vs. process context switch
Could any one tell me what is exactly done in both situations? What is the main cost each of them?
147
votes
9
answers
442k
views
Any way to write a Windows .bat file to kill processes? [closed]
Every time I turn on my company-owned development machine, I have to kill 10+ processes using the Task Manager or any other process management app just to get decent performance out of my IDE. Yes, ...
145
votes
15
answers
167k
views
How to check if there exists a process with a given pid in Python?
Is there a way to check to see if a pid corresponds to a valid process? I'm getting a pid from a different source other than from os.getpid() and I need to check to see if a process with that pid ...
135
votes
13
answers
351k
views
Kill a Process by Looking up the Port being used by it from a .BAT
In Windows what can look for port 8080 and try to kill the process it is using through a .BAT file?
133
votes
17
answers
291k
views
Kill process by name?
I'm trying to kill a process (specifically iChat). On the command line, I use these commands:
ps -A | grep iChat
Then:
kill -9 PID
However, I'm not exactly sure how to translate these commands ...
133
votes
20
answers
112k
views
w3wp process not found
I use Visual Studio 2010 to debug a asp.net MVC project in my local machine. The steps are:
Click Debug and try to attch process "w3wp.exe". However it is not in the list.
I am sure "Show processes ...