Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a command to create multiple files in the current directory? i.e. if I would like to create __init__.py, views.py, models.py and admin.py as follows:

> COMMAND __init__.py views.py models.py admin.py

What would COMMAND be?

share|improve this question
up vote 8 down vote accepted

touch __init__.py views.py models.py admin.py

share|improve this answer
I'm accepting this answer over binfalses because it's more general purpose. – wassimans Apr 24 '11 at 20:38
touch {__init__,views,models,admin}.py
share|improve this answer
Thanks for the tip. – wassimans Apr 24 '11 at 20:38

Using touch is probably the most generally accepted way to accomplish this, but in some shells such as zsh there is something called "multiple stream output redirection" which would allow you do do something like this:

> __init__.py > views.py > models.py > admin.py

..all as one command. If you use globs as suggested by binfalse you don't need to repeat the output operator:

> {__init__,views,models,admin}.py

This is often useful if you want to start all files out with a few common items like their hash-bang and maybe some includes. I often head some other script and redirect it to several files like this if I'm going to write a couple new gigs.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.