案例一:删目录
ll | grep '^d' | awk '{print $9}' | xargs -n 1 echo 'rm -rf'
执行
ll | grep '^d' | awk '{print $9}' | xargs -n 1 echo 'rm -rf' | sh
案例二:杀进程
ps -ef | grep sleep.sh | grep -v grep | awk '{print $2}' | xargs -n 1 echo 'kill -9'
执行
ps -ef | grep sleep.sh | grep -v grep | awk '{print $2}' | xargs -n 1 echo 'kill -9' | sh