Skip to content

Instantly share code, notes, and snippets.

@NotKyon
Created December 3, 2016 02:03
Show Gist options
  • Save NotKyon/4f87cec72c3041b483102e068cc95e62 to your computer and use it in GitHub Desktop.
Save NotKyon/4f87cec72c3041b483102e068cc95e62 to your computer and use it in GitHub Desktop.
Kill all processes holding a given resource.
lsof | grep "name of file" | egrep -v "COMMAND PID USER" | awk '${print $2}' | sort -n | uniq | xargs kill -9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment