简体   繁体   中英

Bash Shell: close all windows and programs UNIX

How would I make a script to exit all programs and windows using bash shell commands and automator on a unix machine?

without using an extra program such as

xdotool search "" windowkill %@

try this:

#!/bin/bash

command=$(ps aux | awk '{print $1,$2}' | grep $USER)

for i in $command; do
    kill -9 ${i};

done    

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM