Bash Windows下的Grep替代方案
我在Unix中有命令Bash Windows下的Grep替代方案,bash,command-line,grep,find,Bash,Command Line,Grep,Find,我在Unix中有命令grep public-A 5,它在字符串public后打印后面的5行 我需要在Windows中使用命令提示符执行同样的操作。我该怎么做 使用powershell powershell -command "Get-ChildItem *.* | Select-String 'public' -context 0,5" 如果将*.替换为文件名模式,则该问题已作为重复问题结束,尽管该问题与已结束的问题不同,因为非建设性问题可能是更好的候选者
grep public-A 5
,它在字符串public
后打印后面的5行
我需要在Windows中使用命令提示符执行同样的操作。我该怎么做 使用powershell
powershell -command "Get-ChildItem *.* | Select-String 'public' -context 0,5"
如果将
*.
替换为文件名模式,则该问题已作为重复问题结束,尽管该问题与已结束的问题不同,因为非建设性问题可能是更好的候选者