SURF Research Boot Camp 2018-04-10
Detach from work

HvA logo

UvA logo

SURF logo

This is an exercise from the Extras part of the Tutorial SURF Research Boot Camp 2018-04-10.

This exercise lets you experience the difference between local and remote computation: you can organize your work so that it continues after you close your laptop.

You will run a simple program that outputs a line each few seconds and experience what happens when you detach from the program in various ways.


while sleep 2
chmod u+x

First detach

# look for a line like this:
#  ...

Food for brain:

Is pstree command installed? If not, are you able to figure out how to install it? After all, you are the sysadmin!

Suggestion just in case:

Using nohup

nohup ./ &

The output will be:

nohup: ignoring input and appending output to ‘nohup.out’
tail -f nohup.out
tail -f nohup.out

For more information read the manual, it is small and simple but effective.

man nohup

Using screen

You will use a program called screen. Similar programs are: tmux, dtach+dtvm.


[detached from 14691.pts-0.145]
screen -r

Multiple screen sessions

screen command has a lot of options. Reading the manual page will provide you with a wealth of information.


Start additional session

Play with these switching commands between the three sessions using control-a and a digit or the control-a control-a sequences

Split screen