Facebook X (Twitter) Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook X (Twitter) Instagram
    TecAdmin
    You are at:Home»Linux Commands»How to close terminal without killing running processes on Linux

    How to close terminal without killing running processes on Linux

    By RahulFebruary 26, 20201 Min Read

    For example, you are running time-consuming processes and you don’t want that job killed due to terminal closed. To handle this situation, you can simply remove a job from an active job table. So that the job will not be killed when the terminal is closed.

    Instructions

    Follow the below instruction to detach running jobs from the terminal.

    • 1. Press CTRL + Z to suspend current running process.
      zip -q -r home.zip *
      
      ^Z
      [1]+  Stopped                 zip -q -r home.zip *
      
    • 2. Then run the stopped process in the background by running bg command. It will put the last stopped process to background.
      bg
      
      [1]+ zip -q -r home.zip * &
      
    • 3. Finally, remove the above job from the table of active job. Use [disown -h jobspec] where [jobspec] is the job number of background running job. Like %1 for the first running job.
      disown -h %1
      

      Note: Here 1 is the job ID of background running job. You can also use the “jobs -l” command to find job id.

    disown command example

    disown terminal
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    How to Ignore SSL Certificate Check with Wget

    How to Ignore SSL Certificate Check with Curl

    echo Command in Linux with Practical Examples

    View 2 Comments

    2 Comments

    1. Yash on February 19, 2021 11:55 am

      Thanks for the tut.
      Btw aren’t there codes for the same?
      lik kill -9 is for forece stop
      so I thouch CONT and STOP will have some codes…

      Reply
    2. adam on February 25, 2020 1:39 pm

      thanks for the tut Rahul

      Reply

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • Using .env Files in Django
    • Using .env File in FastAPI
    • Setting Up Email Notifications for Django Error Reporting
    • How to Enable Apache Rewrite (mod_rewrite) Module
    • What are Microservices?
    Facebook X (Twitter) Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.