Linux fg bg jobs

2010 단어 linux
Linux  fg bg             ,      (    )              。              ,           ,            ;                           。

                :

Ctrl+C

            ,  SHELL

Ctrl+Z

         ,        ,  SHELL

jobs

            ,         

&

     ,       &         

fg N

        N           , %N

bg N

        N           

          :

[maple@linux ~]$  ping baidu.com -a >/dev/null &
[1] 12879
[maple@linux ~]$ jobs
[1]+  Running                 ping baidu.com -a > /dev/null &
[maple@linux ~]$
[maple@linux ~]$ ping google.com -a >/dev/null
#Ctrl+Z
[2]+  Stopped                 ping google.com -a > /dev/null
[maple@linux ~]$ jobs
[1]-  Running                 ping baidu.com -a > /dev/null &
[2]+  Stopped                 ping google.com -a > /dev/null
[maple@linux ~]$
[maple@linux ~]$ fg 1
ping baidu.com -a > /dev/null
#Ctrl+Z
[1]+  Stopped                 ping baidu.com -a > /dev/null
[maple@linux ~]$ jobs
[1]+  Stopped                 ping baidu.com -a > /dev/null
[2]-  Stopped                 ping google.com -a > /dev/null
[maple@linux ~]$
[maple@linux ~]$ bg 2
[2]- ping google.com -a > /dev/null &
[maple@linux ~]$ jobs
[1]+  Stopped                 ping baidu.com -a > /dev/null
[2]-  Running                 ping google.com -a > /dev/null &
[maple@linux ~]$
[maple@linux ~]$ %2
ping google.com -a > /dev/null
#Ctrl+Z
[2]+  Stopped                 ping google.com -a > /dev/null
[maple@linux ~]$ jobs
[1]-  Stopped                 ping baidu.com -a > /dev/null
[2]+  Stopped                 ping google.com -a > /dev/null
[maple@linux ~]$
[maple@linux ~]$

좋은 웹페이지 즐겨찾기