2 ms·
The same in PowerShell - using ls without the abundance of parameters - would look like: ls | sort -des LastWriteTime | select name 1: Get the "child" item
by useerup 11y ago
The same in PowerShell - using ls without the abundance of parameters - would look like:
ls | sort -des LastWriteTime | select name
1: Get the "child" items of the current directory
2: sort them descending according to the last write time
3: strip out all other properties but name
No need for ls to support a plethora of formatting options. And the typing is actually pretty short due to tab completion:
ls | sort -des *time<tab><tab><tab><tab><tab> | select n<tab>
I could not remember what the "last change time" was called, so I just entered *time and used tab completion. PowerShell is smart enough to be aware that (one of) the output types from "ls" has a property called "LastWriteTime" - it came up after 5 tabs. Similarly when pressing n<tab> in the select it completed directly to Name because it knew (still from the pipeline) that output of "ls" would have a "Name" property - even if sorted first.