Answer the question
In order to leave comments, you need to log in
How to find and rename all files by removing a substring (-git)?
seems simple, but these two simple scripts don't work (don't want to use/set rename)
find . -type f -name "*.txt" -exec sh -c 'mv "$0" $(echo -n "${$0/-git/}")' '{}' \;
find . -type f -name "*.txt" -print0 | xargs -0 -I{} fname={} && mv "$fname" $(echo -n "${$fname/-git/}")
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question