chmln / sd

Intuitive find & replace CLI (sed alternative)
MIT License
5.72k stars 136 forks source link

Feature Request: renaming files? #289

Closed pickx closed 8 months ago

pickx commented 8 months ago

it would be nice to be able to use sd to rename file(s), especially in bulk: something like sd --rename before after *.zip would rename all the files that match that glob instead of modifying their contents. (I have no strong feelings about how this syntax should look like).

yes, this is fairly trivial to do (by piping or variable assignment), and not something that sed is typically used for. however, existing solutions which you would be encouraged to use here instead of sed, either use sed-like syntax for renaming (such as the rename program), or built-in shell commands. I would like to move away from having to use syntax like that.

CosmicHorrorDev commented 8 months ago

Personally I'd say this functionality seems too far away from what I would expect from sed or sd. It seems much better suited to -exec/--exec with find/fd

nc7s commented 8 months ago

You may be interested in https://github.com/ismaelgv/rnr.

pickx commented 8 months ago

You may be interested in https://github.com/ismaelgv/rnr.

although I don't like some of the choices made for defaults, that seems to do exactly what I want. thanks. closing this since I no longer have a need for this.