Skip to content

Instantly share code, notes, and snippets.

@selimhex
Last active May 22, 2024 20:20
Show Gist options
  • Save selimhex/84b43d55696ad1833ae4b8e51d970cf9 to your computer and use it in GitHub Desktop.
Save selimhex/84b43d55696ad1833ae4b8e51d970cf9 to your computer and use it in GitHub Desktop.
search (filter) and destroy (kill) running process oneliners
# list all the processes and filter by "ssh" and kill the selected process
ps -eo pid,command | grep ssh | fzf | awk '{print $1}' | xargs kill
# search for the process and kill the selected process
# use ' before keyword to search for the exact keyword (e.g. 'ssh)
ps -eo pid,command | fzf | awk '{print $1}' | xargs kill
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment