How to return a background task to be in the foreground?Where do background jobs go?How to suspend and bring...
Junior developer struggles: how to communicate with management?
Binary Numbers Magic Trick
You look catfish vs You look like a catfish?
What word means "to make something obsolete"?
I caught several of my students plagiarizing. Could it be my fault as a teacher?
Why do freehub and cassette have only one position that matches?
Stark VS Thanos
Is this homebrew race based on the Draco Volans lizard species balanced?
How to assert on pagereference where the endpoint of pagereference is predefined
What is the limiting factor for a CAN bus to exceed 1Mbps bandwidth?
Why is Arya visibly scared in the library in S8E3?
How to implement float hashing with approximate equality
How can I fairly adjudicate the effects of height differences on ranged attacks?
Why do money exchangers give different rates to different bills
If 1. e4 c6 is considered as a sound defense for black, why is 1. c3 so rare?
Is it cheaper to drop cargo than to land it?
Copy line and insert it in a new position with sed or awk
Unexpected email from Yorkshire Bank
Can a cyclic Amine form an Amide?
Selecting a secure PIN for building access
Pigeonhole Principle Problem
If Melisandre foresaw another character closing blue eyes, why did she follow Stannis?
Meaning of "individuandum"
When do aircrafts become solarcrafts?
How to return a background task to be in the foreground?
Where do background jobs go?How to suspend and bring a background process to foregroundHow do you send command line apps directly to the background?Background vs foreground task and running tasks in parallelSchedule a job to run in the background ( one time task scheduling using at )how to kill job in background?What is the main difference between foreground and background process?How do I wait for background jobs in the background?Foreground and BackgroundAccess foreground data from background process
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}
I would like to know how to stop a running process after appending it with &.
For example, I would like to install software foo. Now, assume, foo has many dependancies, it takes an hour to finish. So, I do: yum install foo &. But I would like to stop that on-going process either by making it foreground (the actual premise of my question) so I can interrupt it, or through other methods if necessary.
Ctrl+C does not seem to stop this.
shell background-process jobs
add a comment |
I would like to know how to stop a running process after appending it with &.
For example, I would like to install software foo. Now, assume, foo has many dependancies, it takes an hour to finish. So, I do: yum install foo &. But I would like to stop that on-going process either by making it foreground (the actual premise of my question) so I can interrupt it, or through other methods if necessary.
Ctrl+C does not seem to stop this.
shell background-process jobs
Try looking for the PID:pu aux | grep foo
– ryekayo
Sep 29 '14 at 19:57
add a comment |
I would like to know how to stop a running process after appending it with &.
For example, I would like to install software foo. Now, assume, foo has many dependancies, it takes an hour to finish. So, I do: yum install foo &. But I would like to stop that on-going process either by making it foreground (the actual premise of my question) so I can interrupt it, or through other methods if necessary.
Ctrl+C does not seem to stop this.
shell background-process jobs
I would like to know how to stop a running process after appending it with &.
For example, I would like to install software foo. Now, assume, foo has many dependancies, it takes an hour to finish. So, I do: yum install foo &. But I would like to stop that on-going process either by making it foreground (the actual premise of my question) so I can interrupt it, or through other methods if necessary.
Ctrl+C does not seem to stop this.
shell background-process jobs
shell background-process jobs
edited 1 hour ago
Rui F Ribeiro
42.5k1485146
42.5k1485146
asked Sep 29 '14 at 19:55
robue-a7119895robue-a7119895
2763615
2763615
Try looking for the PID:pu aux | grep foo
– ryekayo
Sep 29 '14 at 19:57
add a comment |
Try looking for the PID:pu aux | grep foo
– ryekayo
Sep 29 '14 at 19:57
Try looking for the PID:
pu aux | grep foo– ryekayo
Sep 29 '14 at 19:57
Try looking for the PID:
pu aux | grep foo– ryekayo
Sep 29 '14 at 19:57
add a comment |
4 Answers
4
active
oldest
votes
If the terminal you launched the command from is still open, you can get it back by running fg.
If it is not, identify the process ID by running ps aux | grep yum or just pgrep yum and then use kill PID. Or, if you know you only have one yum instance, run pkill yum.
So, this will kill the entireyumprocess. Not specific to thatfoothread?
– robue-a7119895
Sep 29 '14 at 20:07
3
@CONtext not sure what you mean. The "foo thread" is the yum process. In any case, thefgdoesn't kill anything, it just brings a backgrounded job back to the foreground.
– terdon♦
Sep 29 '14 at 20:08
add a comment |
If you are in the same shell, you can always foreground that process with fg (if your shell supports it) at that point you can perform your Ctrl+C.
As others have mentioned, you can use a wide variety of ps and kill options.
If you want, you can even use top and filter to your username and kill that way.
add a comment |
Try this:
kill -QUIT `pidof yum`
This will stop, terminate this process.
It may be required to use some better force than QUIT signal, then try TERM and after that try KILL.
You may be also a little more lazy and just do this:
killall -QUIT yum
This will hit all processes named yum.
add a comment |
The key combination you are looking for isn't
ctrl-c
you use that when you interrupt the process (equivalent to using ctrl-c)
If you ctrl-z instead you would place the job in the background, similar to using & at the end.
However this way you would be able to bring the process back to the foreground by using fg
Alternatively you can look for the pid using pidof as mentioned by Scyld
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f158284%2fhow-to-return-a-background-task-to-be-in-the-foreground%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
If the terminal you launched the command from is still open, you can get it back by running fg.
If it is not, identify the process ID by running ps aux | grep yum or just pgrep yum and then use kill PID. Or, if you know you only have one yum instance, run pkill yum.
So, this will kill the entireyumprocess. Not specific to thatfoothread?
– robue-a7119895
Sep 29 '14 at 20:07
3
@CONtext not sure what you mean. The "foo thread" is the yum process. In any case, thefgdoesn't kill anything, it just brings a backgrounded job back to the foreground.
– terdon♦
Sep 29 '14 at 20:08
add a comment |
If the terminal you launched the command from is still open, you can get it back by running fg.
If it is not, identify the process ID by running ps aux | grep yum or just pgrep yum and then use kill PID. Or, if you know you only have one yum instance, run pkill yum.
So, this will kill the entireyumprocess. Not specific to thatfoothread?
– robue-a7119895
Sep 29 '14 at 20:07
3
@CONtext not sure what you mean. The "foo thread" is the yum process. In any case, thefgdoesn't kill anything, it just brings a backgrounded job back to the foreground.
– terdon♦
Sep 29 '14 at 20:08
add a comment |
If the terminal you launched the command from is still open, you can get it back by running fg.
If it is not, identify the process ID by running ps aux | grep yum or just pgrep yum and then use kill PID. Or, if you know you only have one yum instance, run pkill yum.
If the terminal you launched the command from is still open, you can get it back by running fg.
If it is not, identify the process ID by running ps aux | grep yum or just pgrep yum and then use kill PID. Or, if you know you only have one yum instance, run pkill yum.
edited Sep 29 '14 at 19:58
Ramesh
24.2k34106188
24.2k34106188
answered Sep 29 '14 at 19:57
terdon♦terdon
135k33274452
135k33274452
So, this will kill the entireyumprocess. Not specific to thatfoothread?
– robue-a7119895
Sep 29 '14 at 20:07
3
@CONtext not sure what you mean. The "foo thread" is the yum process. In any case, thefgdoesn't kill anything, it just brings a backgrounded job back to the foreground.
– terdon♦
Sep 29 '14 at 20:08
add a comment |
So, this will kill the entireyumprocess. Not specific to thatfoothread?
– robue-a7119895
Sep 29 '14 at 20:07
3
@CONtext not sure what you mean. The "foo thread" is the yum process. In any case, thefgdoesn't kill anything, it just brings a backgrounded job back to the foreground.
– terdon♦
Sep 29 '14 at 20:08
So, this will kill the entire
yum process. Not specific to that foo thread?– robue-a7119895
Sep 29 '14 at 20:07
So, this will kill the entire
yum process. Not specific to that foo thread?– robue-a7119895
Sep 29 '14 at 20:07
3
3
@CONtext not sure what you mean. The "foo thread" is the yum process. In any case, the
fg doesn't kill anything, it just brings a backgrounded job back to the foreground.– terdon♦
Sep 29 '14 at 20:08
@CONtext not sure what you mean. The "foo thread" is the yum process. In any case, the
fg doesn't kill anything, it just brings a backgrounded job back to the foreground.– terdon♦
Sep 29 '14 at 20:08
add a comment |
If you are in the same shell, you can always foreground that process with fg (if your shell supports it) at that point you can perform your Ctrl+C.
As others have mentioned, you can use a wide variety of ps and kill options.
If you want, you can even use top and filter to your username and kill that way.
add a comment |
If you are in the same shell, you can always foreground that process with fg (if your shell supports it) at that point you can perform your Ctrl+C.
As others have mentioned, you can use a wide variety of ps and kill options.
If you want, you can even use top and filter to your username and kill that way.
add a comment |
If you are in the same shell, you can always foreground that process with fg (if your shell supports it) at that point you can perform your Ctrl+C.
As others have mentioned, you can use a wide variety of ps and kill options.
If you want, you can even use top and filter to your username and kill that way.
If you are in the same shell, you can always foreground that process with fg (if your shell supports it) at that point you can perform your Ctrl+C.
As others have mentioned, you can use a wide variety of ps and kill options.
If you want, you can even use top and filter to your username and kill that way.
answered Sep 29 '14 at 20:28
SailorCireSailorCire
1,8781921
1,8781921
add a comment |
add a comment |
Try this:
kill -QUIT `pidof yum`
This will stop, terminate this process.
It may be required to use some better force than QUIT signal, then try TERM and after that try KILL.
You may be also a little more lazy and just do this:
killall -QUIT yum
This will hit all processes named yum.
add a comment |
Try this:
kill -QUIT `pidof yum`
This will stop, terminate this process.
It may be required to use some better force than QUIT signal, then try TERM and after that try KILL.
You may be also a little more lazy and just do this:
killall -QUIT yum
This will hit all processes named yum.
add a comment |
Try this:
kill -QUIT `pidof yum`
This will stop, terminate this process.
It may be required to use some better force than QUIT signal, then try TERM and after that try KILL.
You may be also a little more lazy and just do this:
killall -QUIT yum
This will hit all processes named yum.
Try this:
kill -QUIT `pidof yum`
This will stop, terminate this process.
It may be required to use some better force than QUIT signal, then try TERM and after that try KILL.
You may be also a little more lazy and just do this:
killall -QUIT yum
This will hit all processes named yum.
answered Sep 29 '14 at 20:00
Scyld de FraudScyld de Fraud
1,991711
1,991711
add a comment |
add a comment |
The key combination you are looking for isn't
ctrl-c
you use that when you interrupt the process (equivalent to using ctrl-c)
If you ctrl-z instead you would place the job in the background, similar to using & at the end.
However this way you would be able to bring the process back to the foreground by using fg
Alternatively you can look for the pid using pidof as mentioned by Scyld
add a comment |
The key combination you are looking for isn't
ctrl-c
you use that when you interrupt the process (equivalent to using ctrl-c)
If you ctrl-z instead you would place the job in the background, similar to using & at the end.
However this way you would be able to bring the process back to the foreground by using fg
Alternatively you can look for the pid using pidof as mentioned by Scyld
add a comment |
The key combination you are looking for isn't
ctrl-c
you use that when you interrupt the process (equivalent to using ctrl-c)
If you ctrl-z instead you would place the job in the background, similar to using & at the end.
However this way you would be able to bring the process back to the foreground by using fg
Alternatively you can look for the pid using pidof as mentioned by Scyld
The key combination you are looking for isn't
ctrl-c
you use that when you interrupt the process (equivalent to using ctrl-c)
If you ctrl-z instead you would place the job in the background, similar to using & at the end.
However this way you would be able to bring the process back to the foreground by using fg
Alternatively you can look for the pid using pidof as mentioned by Scyld
answered Sep 29 '14 at 20:51
Michael DurrantMichael Durrant
16.7k47122190
16.7k47122190
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f158284%2fhow-to-return-a-background-task-to-be-in-the-foreground%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Try looking for the PID:
pu aux | grep foo– ryekayo
Sep 29 '14 at 19:57