In my scenario, I have some photos and I want to keep them seperate. At present I am doing mkdir gallery1 gallery2 gallery3 gallery4 gallery5 gallery6, this is a pain. I think we can do it easily as well. Suppose I want to make directories from gallery7 to gallery50. How would I do that?
Tell me more
×
Unix & Linux Stack Exchange is a question and answer site for
users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.
|
|
||||
|
|
|
While there are already fine answers, and you have already started, I'll throw mine in anyway. I always prefer to make numerically sequenced files with leading zeros, like so:
This will give you directories |
|||
|
As the already mentioned brace expansion isn't supported by all shells you can also use
Option |
|||
|
|
|
You can use brace expansion in a bash script. The following creates the directories gallery7 to gallery50 in the current directory:
|
|||
|