In defense of PowerShell
benwilson.me56 pointsby Raesan78 comments
(Select-String "pattern" -Path file.txt).Line > t.txt
Select-String "Pattern" -Path file.txt | Select-Object -ExpandProperty Line > t.txt
Or equivalent to the second example but with shortcuts: sls pattern -path file.txt | select -exp line > t.txt