Last active
October 21, 2015 11:14
-
-
Save hectorperez/60c827edf1b1885d4ccb to your computer and use it in GitHub Desktop.
insert a comment on the top of all files with an extension in a directory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# If you want to add a comment to all files with an extension (e.g. ".rb"): | |
find . -maxdepth 1 -type f -name "*.rb" -exec sed -i '1i #comment' {} \; | |
# And recursive: | |
find . -type f -name "*.rb" -exec sed -i '1i #comment' {} \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment