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;
}







3















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.










share|improve this question

























  • Try looking for the PID: pu aux | grep foo

    – ryekayo
    Sep 29 '14 at 19:57


















3















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.










share|improve this question

























  • Try looking for the PID: pu aux | grep foo

    – ryekayo
    Sep 29 '14 at 19:57














3












3








3








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.










share|improve this question
















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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



















  • 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










4 Answers
4






active

oldest

votes


















6














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.






share|improve this answer


























  • So, this will kill the entire yum process. Not specific to that foo thread?

    – 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, the fg doesn't kill anything, it just brings a backgrounded job back to the foreground.

    – terdon
    Sep 29 '14 at 20:08



















3














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.






share|improve this answer































    2














    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.






    share|improve this answer































      0














      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






      share|improve this answer
























        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
        });


        }
        });














        draft saved

        draft discarded


















        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









        6














        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.






        share|improve this answer


























        • So, this will kill the entire yum process. Not specific to that foo thread?

          – 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, the fg doesn't kill anything, it just brings a backgrounded job back to the foreground.

          – terdon
          Sep 29 '14 at 20:08
















        6














        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.






        share|improve this answer


























        • So, this will kill the entire yum process. Not specific to that foo thread?

          – 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, the fg doesn't kill anything, it just brings a backgrounded job back to the foreground.

          – terdon
          Sep 29 '14 at 20:08














        6












        6








        6







        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.






        share|improve this answer















        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.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Sep 29 '14 at 19:58









        Ramesh

        24.2k34106188




        24.2k34106188










        answered Sep 29 '14 at 19:57









        terdonterdon

        135k33274452




        135k33274452













        • So, this will kill the entire yum process. Not specific to that foo thread?

          – 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, the fg doesn'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






        • 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

















        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













        3














        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.






        share|improve this answer




























          3














          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.






          share|improve this answer


























            3












            3








            3







            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.






            share|improve this answer













            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.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Sep 29 '14 at 20:28









            SailorCireSailorCire

            1,8781921




            1,8781921























                2














                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.






                share|improve this answer




























                  2














                  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.






                  share|improve this answer


























                    2












                    2








                    2







                    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.






                    share|improve this answer













                    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.







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Sep 29 '14 at 20:00









                    Scyld de FraudScyld de Fraud

                    1,991711




                    1,991711























                        0














                        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






                        share|improve this answer




























                          0














                          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






                          share|improve this answer


























                            0












                            0








                            0







                            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






                            share|improve this answer













                            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







                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Sep 29 '14 at 20:51









                            Michael DurrantMichael Durrant

                            16.7k47122190




                            16.7k47122190






























                                draft saved

                                draft discarded




















































                                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.




                                draft saved


                                draft discarded














                                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





















































                                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







                                Popular posts from this blog

                                Hudson River Historic District Contents Geography History The district today Aesthetics Cultural...

                                The number designs the writing. Feandra Aversely Definition: The act of ingrafting a sprig or shoot of one...

                                Ayherre Geografie Demografie Externe links Navigatiemenu43° 23′ NB, 1° 15′ WL43° 23′ NB, 1°...