-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
  • 496
  • 2
  • 11
  • 27

1 Answers1

2

with powershell

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

where *.* is replaced with filename pattern

Nahuel Fouilleul
  • 18,726
  • 2
  • 31
  • 36