Code Shop

A bit of Ruby, a bit of JavaScript, a bit of love...

    • Edit
    • Delete
    • Autopost

    Unix Job Control

    Unix is a multitasking operating system (like most everyday operating systems nowadays) and as such it has and idea on how to do handle jobs. Jobs are executing which happen on a per shell basis as opposed to processes. Here is a summary of everything that you need to know about UNIX jobs. 

    command &
    When running a command with an ampersand at the end for example "ls &" that job is put into the background and runs which you execute other commands on the shell.

    CTRL-c
    If you want to kill a long running job press this combination to stop the job from running.

    CTRL-z
    Suspends a job, but does not kill it.

    bg %num
    If you suspend a job and want to run it in the background (or you forgot to put a job in the background and put it in the background) run this.

    fg %num
    Run this to bring to front a background job or to run a suspended job in the foreground.
     
    kill %num
    Kills a job number.

    jobs
    List all the active jobs on the shell. There can be multiple jobs with many running in the background.

    set notify
    Notifies immediately on the shell if there is change in the a background job.
    Tags » linux unix
    • 20 December 2009
    • Views
    • 1 Comment
    • Permalink
    • Favorited 0 Times
    • Tweet

    Comments 1 Comment

    Dec 20, 2009
    Thomson said...
    bookmarked.

    Leave a Comment

  • Abhi Yerra's Posterous

    An entity composed of reality and pseudo-reality. Enjoys coding, news, history, photography.

  • About Abhi Yerra

    An entity composed of reality and pseudo-reality. Enjoys coding, news, history, photography.

  • Subscribe

    Subscribe to this posterous
    Unsubscribe
    Follow this posterous RSS
  • Follow Me

             

Theme created for Posterous by Obox