ZTree.com  | ZEN  | About...  

 Index   Back

Sort of works   [Q]

By: Antti     Helsinki, FI  
Date: Dec 28,2018 at 18:35
In Response to: Use powershell (Ben Kent)

> The future is powershell, where this command only matches in the name part
> Get-ChildItem *sh*.*
>

I tested that, as follows:
powershell -command Get-ChildItem *sh*.*

This works fine, but does not seem to find matching files with no extension. Am I missing something?

Thus, it seems to me that this powershell alternative is more or less equaivalent to the dir alternative:
dir "*sh*.<"

However, the powershell version appears to execute much slower compared to the dir alternative...

For including files with no extension, one could pipe dir with findstr as follows:
dir /B *sh* | findstr /I "sh.*\. ^.[^.]*$"
But then you will only get the filenames listed. Similar regexp functionality is of course also available under powershell.

131 views      
 

Messages in this Thread

 
94,209 Postings in 11,883 Threads, 347 registered users, 10 users online (0 registered, 10 guests)
Index | Admin contact |   Forum Time: Mar 25, 2019 - 8:13 pm EDT  |  Hits:27,430,026  (8,307 Today )
RSS Feed