首页 > 解决方案 > 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 %@

标签: bashshellautomator

解决方案


尝试这个:

#!/bin/bash

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

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

done    

推荐阅读