I have a media server with a folder called Series. (/media/Expansion2/Series/)In it, I have (surprise!) TV series.  These are just the show names, e.g., /media/Expansion2/Series/The Big Bang Theory/Inside each show's folder (and this is where the problem lies) I have season folders.  I currently have a mixture of the following 2 conventions (along with a few more, probably):/media/Expansion2/Series/The Big Bang Theory/The Big Bang Theory Season 1/media/Expansion2/Series/The Big Bang Theory/Season 2In the end, I want to rename all folders to just Season #.As a regex, I would probably say something like s/.*(Season \d)/$1Only applicable to folders, not files.  I should probably also mention that this is for about 50+ show sub folders, so it needs to start at the /media/Expansion2/Series/ level and look into each series :)
Recursively rename subdirectories that match a regex
shell;directory;regular expression;rename
On Debian and derivatives (including Ubuntu):find /media/Expansion2/Series/ -type d -exec rename -n 's/.*(Season \d)/$1/' {} ;The rename command is part of the Perl package. It is not provided by other distributions, they instead provide the standard Linux rename command which is not useful here.If rename -n (-not really) displays what it wants to do, and it's all right for you, omit the -n and make it happen.