There are some files and folders containing the word apple
.
Like,
Root directory = AppleWorld
->AppleStore -> apple.png, appleStore
->StoreOfApple -> apples -> peaches.png apples.jpg
I want to make all apple
to orange
So the result must be
Root directory = OrangeWorld
->OrangeStore -> orange.png, orangeStore
->StoreOfOrange-> oranges -> peaches.png oranges.jpg`
So, there should be at least 2 operations for apple
and Apple
to orange
and Orange
I tried all rename
commands.
For example these
find ./ -execdir rename 's/Apple*/*Orange*/' '{}' \;
find ./ -iname 'Apple*' -execdir mv -i '{}' 'Orange*' \;
but did not work. What can I do?
find
you could use+
in place of\;
although how much difference it will make is debatable (it still uses at least one invocation per-execdir
, IIRC) – steeldriver Jun 07 '18 at 18:38find . -depth -execdir rename 's/Apple/Orange/;s/apple/orange/;s/APPLE/ORANGE' "{}" ;` i used those and it worked. thank you both :)
– caner aydin Jun 08 '18 at 08:29