Created
February 12, 2022 15:36
-
-
Save scips/9f2153254746cf5de4278945e5fd57a7 to your computer and use it in GitHub Desktop.
Powershell cat tail head ...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gc log.txt | select -first 10 # head | |
gc -TotalCount 10 log.txt # also head | |
gc log.txt | select -last 10 # tail | |
gc -Tail 10 log.txt # also tail (since PSv3), also much faster than above option | |
gc log.txt | more # or less if you have it installed | |
gc log.txt | %{ $_ -replace '\d+', '($0)' } # sed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment