-1

I have the command grep public -A 5 in Unix which prints the trailing 5 lines after the string public.

I need to do the same in Windows using command prompt. How do I do it?

Akhil Kintali
  • 456
  • 2
  • 10
  • 21

1 Answers1

2

with powershell

powershell -command "Get-ChildItem *.* | Select-String 'public' -context 0,5"

where *.* is replaced with filename pattern

Nahuel Fouilleul
  • 17,834
  • 1
  • 28
  • 34