-
đź’ˇPowerShell Tip for Large Files – The Get-Content -Tail and -Wait parameters
In PowerShell, you can display the last *n* lines of large text or ASCII files using the `-Tail` parameter of the `Get-Content` cmdlet: In Powershell, you can display the last *n* lines of large tyt or ASCII files using the -Tail parameter of the Get-Content cmdlet: Since PowerShell version 3, Get-Content (or its alias gc) includes the -Tail parameter. Unfortunately, there is no built-in equivalent to the Unix tail -f command for continuous updates. PowerShell: Get-Content with -Wait PowerShell’s Get-Content cmdlet supports the -Wait parameter, which continuously monitors a file for new content: This will display new lines as they are appended to the file. PowerShell with filtering (advanced usage)…
-
đź’ˇPowershell Tip: Equivalent to Unix ‘ls -ltr | tail’
In PowerShell, the output of the latest n files can be obtained with this command: In this example, the files in the current directory are output using gci, sorted by last write access using sort (newest last), and then only the last 60 are output using select last 60. Related posts