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.

448 views      
Thread locked
 

Messages in this Thread

 
95,075 Postings in 11,986 Threads, 350 registered users, 46 users online (2 registered, 44 guests)
Index | Admin contact |   Forum Time: Aug 13, 2020 - 4:02 pm EDT  |  Hits:33,093,240  (17,162 Today )
RSS Feed