Created
September 6, 2023 19:33
-
-
Save zzzbra/9938c0416d6945a59acf308af16ece71 to your computer and use it in GitHub Desktop.
Delete the first line of every file in local directory if it is an empty line using gnu sed
This file contains hidden or 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
# Need to install gnu-sed. See here: https://formulae.brew.sh/formula/gnu-sed | |
find /path/to/directory -type f -exec gsed -i '1{/^$/d;}' {} + |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment