Hussain Wali
Hussain Wali

Reputation: 318

what does anonymous-*-* mean in this bash command?

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

Upvotes: 1

Views: 103

Answers (1)

Gbox4
Gbox4

Reputation: 633

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.

Upvotes: 1

Related Questions