Kill All Processes Except the One Running the Script

killprocess

I have a aim of killing all processes (Using killall -u myuser) and then restart some processes.
The problem is when the script reaches killall -u myuser it just terminates.

How can I terminate everything (Same as killall -u myuser) but not the script one.

Best Answer

I think

killall -u myuser --ignore-case <script-name>

should do the trick