This site has been archived and will no longer be updated.
You can find my new profile at neilpahl.com. My new blog is at 808.ninja.
Sometimes you want to start a download, update, or what have you. Instead of keeping your terminal (remote connection) open, you can start the process using screen, detach, and then exit/logout.
This cheatsheet is for running a command under screen so that you won't have to stay logged in, or worry about your dodgey connection with your remote host.
just run
screen command_you_want
then, when the screen ui opens, you can press C-a d. (Again, thats hold down cntrl and press a, then d while still holding control). You will then recieve a message saying that your process/job is detached.
run
screen -r
to re-attach. or
screen -r process_id_number
to list all the screen pid's:
screen -list
This is just a quick and dirty on how to use screen to start and detach a process. Screen is normally used in a situation where the connection is unstable. It will create a process which looks much like the normal bash shell (with a few control differences) and keep that screen process running even when the user session ends.
ie, if you ssh into your *nix box, begin your updates with screen, and then logout. The updates will continue until they are finished, even if you are no longer logged in.
for more details, use:
man screen
or better yet, check out the source for a more in depth screen tutorial.
PLEASE let me know if I'm doing something wrong, or if you have any suggestions or requests~
blog comments powered by Disqus