I've been challenged by a friend to do the following:
"Find the quickest and easiest way of sorting a directory listing by the LAST character of the filenames."
He's done it on Linux using the following:
ls | rev | sort | rev
I'd like to show him the powershell alternative, but I'm only just starting to learn powershell and I can't do it. So, I'm cheating and asking for your help.
Here's my entry:
ls | sort {"$_"[-1]}
and to get pathological:
ls|sort{"$_"[-1]}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With