Blog | Admin | Archives | Heatmap | Recent | Random | Plan
    • 🌊
    • The City
    • The less-well-known Brandenburg Gate in Potsdam.
    • First triathlon in 8 years! 
#blenheimtriathlon 2017

How to Reattach to Screen When `screen -r -d` hangs

Based on an answer on serverfault, but modified to work on linux:

Use this one-liner to get the bash and sshd processes currently hanging onto the old screen.

ps aux | grep $(ps aux | grep [s]creen | grep -o 'pts[^ ]*') | grep 'sshd\|bash'

Kill these processes and screen is recoverable before the long and arbitrary timeout.