Pergunta de entrevista da empresa Yahoo

How would you kill all processes for user "abc" with name xyz, using only a single command on the command line of UNIX/FreeBSD system. You are allowed to use pipes and sudo commands. Use of killall is not permitted.

Resposta da entrevista

Sigiloso

11 de mar. de 2009

ps -aefu abc | grep xyz | awk '{print $2}' | sudo xargs kill -9

4