Middleware,  PowerShell

💡Powershell Tip: Equivalent to Unix ‘ls -ltr | tail’

In PowerShell, the output of the latest n files can be obtained with this command:

PowerShell
   Get-ChildItem | sort LastWriteTime | Select -Last 60

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