by growt · 13y ago · 0 comments
ctrl-z - stops a program
bg - sends the stopped program to the background
fg - gets the program back to the foreground (interactive mode)
very useful in editor sessions or when you want to get rid of the endless download/scp that is blocking your terminal
$ some_command
^Z (hit control z)
$ some_command_2
^Z (hit control z)
$ jobs
[1]- Stopped some_command
[2]+ Stopped some_command_2
$ kill %1
$ jobs
[1]- Terminated: 15 some_command
[2]+ Stopped some_command_2 $ alias b='echo -e "\a"'
$ long_running_thing
^Z
$ fg ; b
[long_running_thing resumes]
Then when the job completes, the terminal bell will ring and my window manager will get my attention.fork() { (setsid "$@" &); }
in myzshrc, and then start stuff with :
fork firefox