To bulk rename files, try rename

19 October 2021

The rename utility is available easily for MacOS, linux and FreeBSD and can be used to rename files based on a regex. It is particularly useful for removing spaces from filenames.

rename 's/ /_/g' ./*
tree
.
└── The_Hunger_Games_(2012)
    └── The\ Hunger\ Games\ (2012).mkv
rename 's/ /_/g' ./*/*
tree
.
└── The_Hunger_Games_(2012)
    └── The_Hunger_Games_(2012).mkv

The man page has more detail on recursion.