Created
May 29, 2025 11:00
-
-
Save atelierbram/fe615d889f4c8547ac08ca53f86497c7 to your computer and use it in GitHub Desktop.
This command should rename files in subdirectories that don't have a suffix and don't contain a `?` character in their name by appending `.html`
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
find . -mindepth 1 -type f -not -name "*.*" -not -name "*\?*" -exec sh -c 'mv "{}" "{}".html' \; | |
# In this version, I've removed the -name '*.*' option, since we want to rename files that don't have a suffix. | |
# I've also replaced the -not -name '*\?' option with -not -name "*\?*", | |
# which should correctly exclude files that contain a ? character in their name. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment