How to stop a c++ code from running [closed] - linux

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 5 years ago.
Improve this question
I clicked on a.out of a code in Linux, now I want to stop running code but as I didn't use the terminal, I don't know that how can I stop the code from running. What can I do?
I am running another code from last week.
I can not kill both by turn off the computer because the first code is running from previous week and I don't have time to run it again

So, if you're running two instances of a.out (which I'm just assuming because your question is unclear...) then, as other users have said, run:
pgrep a.out
If the second a.out process is the one you want to kill, take the larger PID number (in your case it seems to be 19564) and run:
kill 19564

Related

Hide output from cronjobs running in background [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 3 years ago.
Improve this question
I have few python cronjobs running at a regular interval, set up in crontab. Now I have crond -b running in the background. However, I get following message printed on the console for every run of the cronjob
crond[27827]: USER root pid 27829 cmd python mypythonscript.py
How can I hide these outputs from appearing in the console?
I believe this is crond writing the syslogs and nothing to do with redirecting logs to /dev/null. You could try editing /etc/sysconfig/crond file to set CRONDARGS to
CRONDARGS="-s off"

how to trace a shell script running the background? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
I have run a script like this:
script.sh > terminal.txt 2>&1 &
It contains long loops.
how can I trace (which process with what name and what id was created) that script and kill the process to terminate that?
Type fg in the terminal. Then type Ctrl+c.
See: Job Control Commands
Though, #hek2mgl 's answer was great help and paved the way to solution, but the actual solution is a bit different:
Type fg in the terminal.
Then type Ctrl+z.

How to run a program, one after another [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I'm running many programs (all written in fortran). Right now I'm running one program (./first) but I would like that once it is finished another one starts running (./second), and once that other program finishes the next one starts (./third) and so on. Any idea how can I do that from the terminal? Thanks!
how about
./first && ./second && ./third
or
./first ; ./second ; ./third
in the first case, the chain is interrupted, if one of the programs fails (exits with exit code != 0). in the second case, the applications keep on running, even if one of them (e.g. ./second) is going to fail.
Assuming you're using bash or a compatible shell:
Put first in the background by pressing Ctrl-Z (not necessary if it's already backgrounded)
Run wait && ./second && ./third

at: how to schedule a job to run at one second later? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I want to use the command "at" to schedule a job to run at one second (or minute/hour) later. If using "-t" option, then it involves with the hassle of getting the current time etc. Is there any easy way out?
But don't suggest me to use "sleep", because the current process will exit.
Thanks for the tip.
The at program can take now+ a time unit (e.g. now+1minute) as a timespec. You won't get finer time resolution than one minute with at.

SSH How to scrutinise what a PID is doing? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I have a rogue Apache process running on a Centos 6 Linux server, which is running up to 55% CPU and wondered how I can scrutinise exactly what function(s) it is performing? From the 'top' command I have its process ID, but how can I drill in to what it's up to?
Thank you
If you really want to see what it's doing, get familiar with the strace command. It will show you the system calls your process is making, but I imagine it would be a terrible tool for finding out performance issues. For that, take a look at something like gprof.

Resources