Image by Ag Ku from Pixabay

TIL how to rename mass files with zsh

Zsh is now the default terminal for macos, replacing well known bash. 

I needed to rename a  lot of files in a project, displayed in multiples and various subfolders. 

I learnt a new command names zmv that comes directly with zsh and that is similar in mv command in various ways. 

To rename all your files in your current folder you can type:

$ zmv '(*).scss' '$1.scss'

To rename all your files in subfolders too you can type

$  zmv '(**/)(*).scss' '$1/$2.module.scss'