I'm using zsh on MX Linux 23.2.
For years I have tried to figure out why a command like
find . -depth -type f -execdir rename 's/_720p//' {} \; skips over files.
I know my file manager can't be trusted to show the changes, so I check by typing ls into the terminal. Lo and behold! There are files listed there with '_720p' still in the name.
I've tried sending the process to the background and using wait, but I get the same results. The only thing I have found is something like
while [ ! .(NF) ]; do filename=$(find . -type f -print0 -quit) rename 's/_720p//' $filename mv $filename $HOME/Videos done I've never seen another question even remotely similar to this one. Am I the only person in the Linuxverse who can't get it right? What is the problem?
_720p? Because afaikrename 's/_720p//'would only replace the first such occurrencerename(or some versions of it) requires at least three parameters:<expression><replacement><file> ....