What is difference between a job and a process in Unix?

后端 未结 8 1292
别跟我提以往
别跟我提以往 2021-02-02 10:53

What is the difference between a job and a process in Unix ? Can you please give an example ?

相关标签:
8条回答
  • 2021-02-02 11:16

    job is when you want to know about processes started from the current shell.

    process is when you want to know about a process running from any shell or computer.

    0 讨论(0)
  • 2021-02-02 11:22

    Jobs are processes which are started by a shell. The shell keeps track of these in a job table. The jobs command shows a list of active background processes. They get a jobspec number which is not the pid of the process. Commands like fg use the jobspec id.

    In the spirit of Jürgen Hötzel's example:

    find $HOME | sort &
    [1] 15317
    $ jobs
    [1]+  Running                 find $HOME | sort &
    $ fg
    find $HOME | sort
      C-c C-z
    [1]+  Stopped                 find $HOME | sort
    $ bg 1
    [1]+ find $HOME | sort &
    

    Try the examples yourself and look at the man pages.

    0 讨论(0)
  • 2021-02-02 11:22

    A job consists of multiple processes running in series or parallel. A process is a program under execution.

    0 讨论(0)
  • 2021-02-02 11:32

    Jobs are one or more processes that are grouped together as a 'job', where job is a UNIX shell concept. A job consists of multiple processes running in series or parallel. while A process is a program under execution. job is when you want to know about processes started from the current shell.

    0 讨论(0)
  • 2021-02-02 11:34

    http://en.wikipedia.org/wiki/Job_control_%28Unix%29:

    Processes under the influence of a job control facility are referred to as jobs.

    0 讨论(0)
  • 2021-02-02 11:35

    http://en.wikipedia.org/wiki/Job_control_%28Unix%29

    Jobs are one or more processes that are grouped together as a 'job', where job is a UNIX shell concept.

    0 讨论(0)
提交回复
热议问题