How to control the jobs with shell?

来源:互联网 发布:淘宝宝贝突然找不到了 编辑:程序博客网 时间:2024/05/17 03:15

There are 3 commands to contol jobs.

1. Ctrl + Z
2. bg & fg
3. kill
4. jobs

For example,

1. robert@debianlaptop:~$ emacs

[1]+  Stopped                 emacs

2. robert@debianlaptop:~$ fg %1
emacs

[1]+  Stopped                 emacs

. robert@debianlaptop:~$ bg %1
[1]+ emacs &

3. robert@debianlaptop:~$ jobs
[1]+  Running                 emacs &

4. robert@debianlaptop:~$ kill %1

 

The processes stopped by Ctrl + Z becom the jobs.

原创粉丝点击