What is {.,}?


 
Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers What is {.,}?
# 1  
Old 03-05-2019
What is {.,}?

I understand
Code:
ls -l {.,}*foo*

is used to list both the hidden and non-hidden files. I want to know what exactly the expression {.,} stands for and what are the other use cases of it
This User Gave Thanks to i4ismail For This Post:
# 2  
Old 03-05-2019
man bash:
Quote:
Brace Expansion
Brace expansion is a mechanism by which arbitrary strings may be generated. This mechanism is similar to pathname expansion, but the filenames generated need not
exist. Patterns to be brace expanded take the form of an optional preamble, followed by either a series of comma-separated strings or a sequence expression between a
pair of braces, followed by an optional postscript. The preamble is prefixed to each string contained within the braces, and the postscript is then appended to each
resulting string, expanding left to right.

Brace expansions may be nested. The results of each expanded string are not sorted; left to right order is preserved. For example, a{d,c,b}e expands into `ade ace abe'.
These 2 Users Gave Thanks to RudiC For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread
Login or Register to Ask a Question