Home > OS >  what does anonymous-*-* mean in this bash command?
what does anonymous-*-* mean in this bash command?

Time:01-14

I know what the ls -d does but I am confused about anonymous-*-* |\ part, can someone please explain this

ls -d $data/anonymous-*-* |\

assuming $data is a directory name

CodePudding user response:

It's called bash globbing, and is really useful for matching filenames and text. The * wildcard matches any text at all. So anonymous-*-* would match any filenames that begin with anonymous-, and have another dash - somewhere after that in the filename.

  •  Tags:  
  • Related