I’m on an Ubuntu platform and have a directory containing many .py files and subdirectories (also containing .py files). I would like to add a line of text to the top of each .py file. What’s the easiest way to do that using Perl, Python, or shell script?
Share
To process all
.pyfiles in a directory recursively run this command in your shell:find . -name '*.py' | xargs perl script.pl