Created
November 19, 2024 22:02
-
-
Save pjobson/e42b87e49ba69f8e3c90a806f0716f14 to your computer and use it in GitHub Desktop.
Script For Killing All Steam Processes in Linux
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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