Start a Linux Process / Command in Background
cepar@DESKTOP-H3LUMQB MINGW64 ~/Desktop
$ sleep 300
cepar@DESKTOP-H3LUMQB MINGW64 ~/Desktop
$ sleep 300 &
[1] 2524
cepar@DESKTOP-H3LUMQB MINGW64 ~/Desktop
$ sleep 400 &
[2] 2528
cepar@DESKTOP-H3LUMQB MINGW64 ~/Desktop
$ jobs
[1]- Running sleep 300 &
[2]+ Running sleep 400 &
cepar@DESKTOP-H3LUMQB MINGW64 ~/Desktop
$ jobs -l
[1]- 2524 Running sleep 300 &
[2]+ 2528 Running sleep 400 &
cepar@DESKTOP-H3LUMQB MINGW64 ~/Desktop
$ fg %1
sleep 300
[1]+ Stopped sleep 300
cepar@DESKTOP-H3LUMQB MINGW64 ~/Desktop
$
cepar@DESKTOP-H3LUMQB MINGW64 ~/Desktop
$ jobs -l
[1]+ 2524 Stopped sleep 300
[2]- 2528 Running sleep 400 &
cepar@DESKTOP-H3LUMQB MINGW64 ~/Desktop
$ bg %1
[1]+ sleep 300 &
cepar@DESKTOP-H3LUMQB MINGW64 ~/Desktop
$ jobs -l
[1]- 2524 Running sleep 300 &
[2]+ 2528 Running sleep 400 &
cepar@DESKTOP-H3LUMQB MINGW64 ~/Desktop
$ kill %2
[2]+ Terminated sleep 400
cepar@DESKTOP-H3LUMQB MINGW64 ~/Desktop
$ kill 2524
[1]+ Terminated sleep 300
cepar@DESKTOP-H3LUMQB MINGW64 ~/Desktop
$ jobs -l
cepar@DESKTOP-H3LUMQB MINGW64 ~/Desktop
$ nohup sleep 500 &
[1] 2562
cepar@DESKTOP-H3LUMQB MINGW64 ~/Desktop
$ nohup: ignoring input and appending output to 'nohup.out'
^C
留言
張貼留言