Home | 簡體中文 | 繁體中文 | 雜文 | 打賞(Donations) | ITEYE 博客 | OSChina 博客 | Facebook | Linkedin | 知乎專欄 | Search | Email

17.6. jobs

17.6.1. &

usage: command &

			
$ grep -r 'neo' / > result &
[1] 10414
			
			

17.6.2. Ctrl + Z

vim

$ vim

[2]+  Stopped                 vim


mutt

$ mutt

[3]+  Stopped                 mutt
			

17.6.3. jobs

			
$ jobs
[1]   Running                 grep -r 'neo' / > result &
[2]-  Stopped                 vim
[3]+  Stopped                 mutt
			
			

17.6.4. fg / bg

usage: fg [job_spec]

$ fg 2
			

usage: bg [job_spec ...]

			
$ cp -r /usr/ /tmp/
Ctrl + Z
[1]+  Stopped                 cp -r /usr/ /tmp/

$ bg
[1]+ cp -r /usr/ /tmp/ &

$ fg
cp -r /usr/ /tmp/
			
			

17.6.5. nohup - run a command immune to hangups, with output to a non-tty

			
nohup command > myout.file 2>&1 &
nohup command >/dev/null 2>/dev/null &
nohup command &>/dev/null
			
			

You may using 'jobs' to display task.

and using 'fg %n' to close that.