N1ng N1ng - 1 year ago 104
Linux Question

Linux mkdir to make directories with serial number

In my CentOS-7, I want to create some directories with names, say name001, name002, ... name003.

How to do this without typing

mkdir name001
mkdir name002

and so on?

Answer Source

remove the echo, if you are happy with the output

for i in $(seq -s " " -f %03g 1 10); do echo mkdir name${i}; done
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download