What do double stars mean?

I often see PowerShell commands that use paths that use double stars:

Copy-Item c:\source\** d:\target

The example may be wrong, as I still do not understand POSH. But I see examples using **in the ways. What does it mean?

+4
source share
2 answers

Actually, I believe that the above answer is incorrect.

Suppose we have the following directory structure:

dbl_wc (top level) --one_level_in --aa.txt --one_level_in1 --bb.txt --deeper_dir --abc.txt

Copy-Item .\dbl_wc\**\*.txt copy_target -Force Will search only * .txt in any directory under. \ Dbl_wc. And it will not look in subdirectories (e.g. \ dbl_wc \ one_level_in1 \ deeper_dir). This way it will get both aa.txt and bb.txt, but not abc.txt. It will also not receive any .txt file directly underdbl_wc

, ** , .

EDIT: *, ( Copy-Item .\dbl_wc\*\*.txt copy_target -Force , )

+2

.

C:\sources\**\*.mp3

c:\sources\cool.mp3
c:\sources\redneck\super_cool.mp3
c:\sources\bluegrass\random\the_coolest.mp3

..

, C:\source ( ) d:\target.

+4

Source: https://habr.com/ru/post/1660862/


All Articles