Perguntaram pro Tomnomnom uma vez (pra quem não sabe, autor do waybackurls, anew, assetfinder, unfurl etc)

Como se saia do jeito certo do vim.

Ele respondeu de zoeira:

ps ax | grep vim | grep -v grep | awk '{print $1}' | xargs -n1 kill 9

Fonte: https://youtu.be/xteTjU8GNMc?si=bJlNgfTmSpq8g6qF&t=8

O mais engraçado foi nos comentários um cara que manja de bash foi simplificando cada vez mais o comando complexo com humor hahaha:

@unbekannter_Nutzer
há 1 ano
ps ax | grep vim | grep -v grep | awk '{print $1}' | xargs -n1 kill 9 is overly complicated, since you can replace the awk-command just with col1 which gives us
ps ax | grep vim | grep -v grep | col1 | xargs -n1 kill 9, but filtering the the vim process is even simpler with ps -C vim:
ps -C vim | col1 | xargs -n1 kill 9. Now ps has flags to control the output:
ps -C vim -o pid= | xargs -n1 kill 9. Even simpler is pidof:
kill $(pidof vim) or just
pkill vim. Of course we aren't barbarians and therefore don't kill with -9, we kill with SIGTERM:
pkill -15 vim.
 
 
Back to Top