Powershell执行cmd的语法:
1 | cmd /c "***Cmd语法" |
cmd遍历出列表:
1 | dir /s /b c:\ |
做成列表交给for循环:
1 | for /f %i in ('dir /s /b c:\1.txt') |
do可以使用&拼接
Bash
遍历出一个列表:
1 | find / -name 1.txt |
遍历利用(管道符传入):
1 | find / -name 1.txt|while read f;do echo $f; done |
1 | find / -name bas.js|while read f;do sh -c 'id;pwd;ifconfig' > $f.txt;done |