When I execute screen -ls, I see the following. How can I kill all the detached sessions?
screen -ls
There are screens on: 84918.tty
There are screens on:
84918.tty
screen -ls | grep pts | cut -d. -f1 | awk '{print $1}' | xargs kill
Kill only Detached screen sessions (credit @schatten):
screen -ls | grep Detached | cut -d. -f1 | awk '{print $1}' | xargs kill