Kill the loginwindow process using the command line on Mac OS X

So far, I have written the following unix command:

ps -Ajc | grep loginwindow | cut -c 16-20 | sed 's/ //g' 

This captures the loginwindow process, filters it with cut and sed to return the loginwindow process number.

I would like to know how to use the number obtained in the process.

Thanks.

+1
source share
2 answers

It seems like a long way. Why not just use killall loginwindow ?

+7
source
 kill `ps -Ajc | grep loginwindow | cut -c 16-20 | sed 's/ //g'` 
0
source

Source: https://habr.com/ru/post/1432067/


All Articles