I understand what brace expansion is, but I don't know how best to use it.
When do you use it?
Please teach me some convenient and remarkable examples if you have your own tip.
bashbrace-expansionkshshellzsh
I understand what brace expansion is, but I don't know how best to use it.
When do you use it?
Please teach me some convenient and remarkable examples if you have your own tip.
Best Answer
Brace expansion is very useful if you have long path names. I use it as a quick way to backup a file:
will copy
/a/really/long/path/to/some/file.txt
to/a/really/long/path/to/some/file.txt.bak
You can also use it in a sequence. I once did so to download lots of pages from the web:
or