« Minimal Reproducible »

Home Tags About GitHub

batch-rename-file-extension-in-a-for-loop

Published at 2024-01-16
Last update over 365 days ago Licensed under CC BY-NC-SA 4.0 softwares-and-toolsfish

Thanks to basename, which is a unix bin file

https://stackoverflow.com/questions/38590165/how-to-rename-file-extentions-in-fish-in-a-for-loop

for file in *.md
    mv -v -- "$file" (basename $file .md).txt 
end

use string replace is also nice.

« Minimal Reproducible »

Powered by Astro