linux前后台任务切换管理

 1 liuyuan@ebuinfo:/var/www/projects/PHPExcel/Examples$ vi 33chartcreate-line.php &

 2 [1] 9927

 3 liuyuan@ebuinfo:/var/www/projects/PHPExcel/Examples$ jobs

 4 [1]+  Stopped                 vi 33chartcreate-line.php

 5 liuyuan@ebuinfo:/var/www/projects/PHPExcel/Examples$ vi 34chartupdate.php 

 6 ...ctrl+z...

 7 [2]+  Stopped                 vi 34chartupdate.php

 8 liuyuan@ebuinfo:/var/www/projects/PHPExcel/Examples$ jobs

 9 [1]-  Stopped                 vi 33chartcreate-line.php

10 [2]+  Stopped                 vi 34chartupdate.php

11 liuyuan@ebuinfo:/var/www/projects/PHPExcel/Examples$ fg

12 vi 34chartupdate.php

13  

14 [2]+  Stopped                 vi 34chartupdate.php

15 liuyuan@ebuinfo:/var/www/projects/PHPExcel/Examples$ jobs

16 [1]-  Stopped                 vi 33chartcreate-line.php

17 [2]+  Stopped                 vi 34chartupdate.php

18 liuyuan@ebuinfo:/var/www/projects/PHPExcel/Examples$ fg %1

19 vi 33chartcreate-line.php

20  

21 [1]+  Stopped                 vi 33chartcreate-line.php

22 liuyuan@ebuinfo:/var/www/projects/PHPExcel/Examples$ bg

23 [1]+ vi 33chartcreate-line.php &

24 liuyuan@ebuinfo:/var/www/projects/PHPExcel/Examples$ jobs

25 [1]+  Stopped                 vi 33chartcreate-line.php

26 [2]-  Stopped                 vi 34chartupdate.php

27 liuyuan@ebuinfo:/var/www/projects/PHPExcel/Examples$ bg %2

28 [2]- vi 34chartupdate.php &

29  

30 [2]+  Stopped                 vi 34chartupdate.php

31 liuyuan@ebuinfo:/var/www/projects/PHPExcel/Examples$ jobs

32 [1]-  Stopped                 vi 33chartcreate-line.php

33 [2]+  Stopped                 vi 34chartupdate.php

34 liuyuan@ebuinfo:/var/www/projects/PHPExcel/Examples$ jobs -l

35 [1]-  9927 Stopped (tty output)    vi 33chartcreate-line.php

36 [2]+  9958 Stopped (tty output)    vi 34chartupdate.php

37 liuyuan@ebuinfo:/var/www/projects/PHPExcel/Examples$ kill 9958

38 liuyuan@ebuinfo:/var/www/projects/PHPExcel/Examples$ jobs -l

39 [1]-  9927 Stopped (tty output)    vi 33chartcreate-line.php

40 [2]+  9958 Stopped (tty output)    vi 34chartupdate.php

41 liuyuan@ebuinfo:/var/www/projects/PHPExcel/Examples$ kill %1

42  

43 [1]+  Stopped                 vi 33chartcreate-line.php

44 liuyuan@ebuinfo:/var/www/projects/PHPExcel/Examples$ jobs

45 [1]+  Stopped                 vi 33chartcreate-line.php

46 [2]-  Stopped                 vi 34chartupdate.php

47 liuyuan@ebuinfo:/var/www/projects/PHPExcel/Examples$ kill %2

48  

49 [2]+  Stopped                 vi 34chartupdate.php

50 liuyuan@ebuinfo:/var/www/projects/PHPExcel/Examples$ jobs

51 [1]-  Stopped                 vi 33chartcreate-line.php

52 [2]+  Stopped                 vi 34chartupdate.php

53 liuyuan@ebuinfo:/var/www/projects/PHPExcel/Examples$ jobs -l

54 [1]-  9927 Stopped (tty output)    vi 33chartcreate-line.php

55 [2]+  9958 Stopped (tty output)    vi 34chartupdate.php

56 liuyuan@ebuinfo:/var/www/projects/PHPExcel/Examples$ nohup skype &

57 [3] 9991

58 liuyuan@ebuinfo:/var/www/projects/PHPExcel/Examples$ nohup: ignoring input and appending output to `nohup.out'

59 ^C

60 liuyuan@ebuinfo:/var/www/projects/PHPExcel/Examples$

 

  

liuyuan@ebuinfo:/var/www/projects/PHPExcel/Examples$ jobs -l

[1]- 9927 Stopped (tty output) vi 33chartcreate-line.php

[2]+ 9958 Stopped (tty output) vi 34chartupdate.php

[3] 9991 Running nohup skype &



liuyuan@ebuinfo:/var/www/projects/PHPExcel/Examples$ kill %3

liuyuan@ebuinfo:/var/www/projects/PHPExcel/Examples$ jobs -l

[1]- 9927 Stopped (tty output) vi 33chartcreate-line.php

[2]+ 9958 Stopped (tty output) vi 34chartupdate.php

[3] 9991 Done nohup skype

  

参考文章:http://blog.sina.com.cn/s/blog_673ee2b50100iywr.html

 

fg

fg %1

bg

bg %1

jobs

jobs -l

nohup

&

ctrl+z

...

你可能感兴趣的:(linux)