Unix 中的作业和进程有什么区别? [英] What is difference between a job and a process in Unix?
本文介绍了Unix 中的作业和进程有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Unix 中的 作业 和 进程 之间有什么区别?你能举个例子吗?
What is the difference between a job and a process in Unix ? Can you please give an example ?
推荐答案
作业是由 shell 启动的进程.shell 在作业表中跟踪这些.作业命令显示活动后台进程的列表.他们得到一个 jobspec 编号,它不是进程的 pid.像 fg 这样的命令使用 jobspec id.
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.
本着 Jürgen Hötzel 示例的精神:
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.
这篇关于Unix 中的作业和进程有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文