扫码关注官方订阅号
各位好:
如题所示,我理解jobs可能是各种应用程序,一个jobs可以对应多个process,这么说对不对? 更准确点的解释应该是什么?
非常感谢!
认证高级PHP讲师
What is the difference between a job and a process? job是shell的概念,process是操作系统的概念。从一定程度上讲,你可以理解为job里可以有多个process。
比如运行:
$ tail -f test.txt | more & [1] 32751 $ jobs [1]+ Running tail -f test.txt | more $ ps af PID TTY STAT TIME COMMAND 32740 pts/1 Ss 0:00 -bash 32750 pts/1 T 0:00 \_ tail -f test.txt 32751 pts/1 T 0:00 \_ more 32752 pts/1 R+ 0:00 \_ ps af 762 tty2 Ss+ 0:00 /sbin/getty 38400 tty2 760 tty1 Ss+ 0:00 /sbin/getty 38400 console
可以看到只启动了一个job,但存在tail和more两个process。
tail
more
你可以阅读一下Understanding Job Control In Bash
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
扫描下载App
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
What is the difference between a job and a process?
job是shell的概念,process是操作系统的概念。从一定程度上讲,你可以理解为job里可以有多个process。
比如运行:
可以看到只启动了一个job,但存在
tail
和more
两个process。你可以阅读一下Understanding Job Control In Bash