FG

kill all processes of a user except a few in linux

Fresh3 days ago
Mar 15, 202619542 views
Confidence Score0%
0%

Problem

I was running some processes under a screen session on a remote server. When I tried to kill all those processes by: all my processes are killed including those I don't want to kill (i.e. the screen and ssh connection). Is there a way to kill all my processes except the screen and ssh connection?

Error Output

pkill -U tim

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: kill all processes of a user except a few in linux

Low Risk

Kinda hackerish: this will kill everything but any ssh or screen processes. Here are the commands explained: -- will obviously, list every process from the user tim -- will remove lines with ssh or screen processes -- will cut the data in columns 11…

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment