Skip to content

Instantly share code, notes, and snippets.

@dev-pmartins
Created July 11, 2016 21:46
Show Gist options
  • Save dev-pmartins/105a8252bfd745de111f2a271eb552ae to your computer and use it in GitHub Desktop.
Save dev-pmartins/105a8252bfd745de111f2a271eb552ae to your computer and use it in GitHub Desktop.
###########
# Matar todos os processos por palavra chave
# Kill A lot of process by keyword
##########
# ps auxf (Só para identar os processos por hierarquia)
# ps auxf (Just list all process orderly by hierarchy)
# grep worker (Grep ué, filtra os resultados pela palavra chave)
# grep worker (Filter output by informated keyword)
# awk (Pega a coluna de acordo com os headers, exemplo: awk {print $1} = primeira coluna de output)
# awk (get informated column by command head, example: awk {print $1} = first column from output)
# xargs (Pega a saida dos comandos anteriores, e itera no comando exposto via argumento)
# xargs (Get previous output, and iterate with command informated after xargs)
ps auxf | grep worker | awk '{print $2}' | xargs kill -9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment