sh 在当前目录的所有目录中创建文件。

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh 在当前目录的所有目录中创建文件。相关的知识,希望对你有一定的参考价值。

# 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

以上是关于sh 在当前目录的所有目录中创建文件。的主要内容,如果未能解决你的问题,请参考以下文章