Skip to content

Instantly share code, notes, and snippets.

@Georgy5
Last active July 30, 2023 13:06
Show Gist options
  • Save Georgy5/776147af417cb31c82ca96d8277e5c3c to your computer and use it in GitHub Desktop.
Save Georgy5/776147af417cb31c82ca96d8277e5c3c to your computer and use it in GitHub Desktop.
Update .ruby-version in several subfolders
# Change the last 6 in the found -ruby-version files to a 7
# You can change to regular expression to be less specific, this was my use case
find ./ -name ".ruby-version" -exec sed -i "s/6$/7/" {} +
# Same thing but only go down one level of subfolders
find ./ -mindepth 2 -name ".ruby-version" -exec sed -i "s/6$/7/" {} +
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment