Skip to content

Instantly share code, notes, and snippets.

@pjobson
Created November 19, 2024 22:02
Show Gist options
  • Save pjobson/e42b87e49ba69f8e3c90a806f0716f14 to your computer and use it in GitHub Desktop.
Save pjobson/e42b87e49ba69f8e3c90a806f0716f14 to your computer and use it in GitHub Desktop.
Script For Killing All Steam Processes in Linux
#!/bin/bash
# Steam on Linux doesn't seem to like to actually
# quit, when you tell it to quit.
# Get all of the Steam processes
STEAMPROCESSES=$(ps aux | grep Steam | grep valvesoftware)
# Loop and kill them one-by-one
while read STEAMPROCESSES; do
PID=$(echo $STEAMPROCESSES | perl -pe 's/^\w+\s+(\d+).+/$1/')
if [[ ! -z "$PID" ]]; then
kill -9 $PID > /dev/null 2>&1
fi
done <<< "$STEAMPROCESSES"
# Get the bwrap process which is doing something for Steam
# and kill it
PID=$(ps aux | grep bwrap | grep steam | perl -pe 's/^\w+\s+(\d+).+/$1/')
kill -9 $PID > /dev/null 2>&1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment