如何在Windows cmd (批处理文件)中编写| (Linux)命令?
我不知道如何在Windows中编写这个小Linux脚本:
find -r * |grep *.fd | open在Windows中:
dir /S ??? open发布于 2011-04-14 16:21:25
我真的不知道open是做什么的。如果它只是用相应的文件启动一个关联的应用程序,那么下面的代码应该会这样做:
for /r %f in (*.fd) do (start "" "%f")在PowerShell中,您可以使用以下命令执行相同的操作:
Get-ChildItem -Recurse -Filter *.fd | Invoke-Item或更短:
gci -rec -fi *.fd | ii发布于 2011-04-14 08:21:54
windows中的常规命令shell缺乏功能和功能。然而,Windows Power Shell能够运行许多类似于*nix Shell的忍者命令。
您可以在MSDN - http://msdn.microsoft.com/en-us/library/aa973757%28v=vs.85%29.aspx上获得更多关于power shell的信息
下面是我从Powershell帮助中搜索到的一个例子:
C:\PS>获取子项c:\windows\system32* -include *.txt -recurse | select-string -pattern "Microsoft“-casesensitive
此命令检查C:\Windows\System32子目录中具有.txt文件扩展名的所有文件,以查找字符串"Microsoft“。CaseSensitive参数表示“Microsoft”中的“M”必须大写,其余字符必须为小写才能匹配。
https://stackoverflow.com/questions/5657035
复制相似问题