Skip to content

Instantly share code, notes, and snippets.

@lanzafame
Created June 6, 2016 01:43
Show Gist options
  • Save lanzafame/1e02669831ecdad40a03a43b320890ad to your computer and use it in GitHub Desktop.
Save lanzafame/1e02669831ecdad40a03a43b320890ad to your computer and use it in GitHub Desktop.
Create file in all the directories in the current directory.
# Create __init__.py in all the directories in the current directory.
# .
# ├── clique
# │   └── clique.py
# ├── __init__.py
# ├── metro
# │   └── metro.py
# ├── pop
# │   └── pop.py
# ├── service
# │   └── service.py
# └── switch
#    └── switch.py
for D in `find . -type d`; do
touch $D/__init__.py;
done
# Result:
# .
# ├── clique
# |   ├── __init__.py
# │   └── clique.py
# ├── __init__.py
# ├── metro
# |   ├── __init__.py
# │   └── metro.py
# ├── pop
# |   ├── __init__.py
# │   └── pop.py
# ├── service
# |   ├── __init__.py
# │   └── service.py
# └── switch
#    ├── __init__.py
#    └── switch.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment