3 ms·
> find -name "data.json" | xargs -i bash -c "mv \"{}\" \"\$(dirname '{}')/data.yml\"" Albeit this task needn't involve a shell at all - just `find` and `rena
by darrenf 4y ago
> find -name "data.json" | xargs -i bash -c "mv \"{}\" \"\$(dirname '{}')/data.yml\""
Albeit this task needn't involve a shell at all - just `find` and `rename`:
find . -name data.json -exec rename .json .yml {} +
- akkartik 4y agoDo you really have rename on your computer? What OS is this?
- nosklo 4y agoI'm not op but I do have `rename` in my computer. I'm using latest fedora linux. It seems to be included with the util-linux package https://packages.fedoraproject.org/pkgs/util-linux/util-linux/fedora-rawhide.html#files https://packages.fedoraproject.org/pkgs/util-linux/util-linu...