detach a screen linux code example Example: kill all screens linux for scr in $(screen -ls | awk '{print $1}'); do screen -S $scr -X kill; done