A Simple Weather Blog

Learn about weather tech

Follow me on GitHub

Rename The Extension Of Multiple Files Trough The Console

Sometimes I have to switch from Linux to Windows and vice versa.

And under both operating systems I use the Transmission torrent client. I've set up a Linux to boot the torrent files from the Windows directory. The problem is that in such cases Transmission for Linux adds the extension "* .added".

If the files are dozens, one should consider automated renaming in order to save time. I have a few options that do work for remove of "*.added" extension:

Pure Bash:

for file in * .added; do mv "$ file" "$ {file% .added}"; done;

Rename command:

rename 's / .added $ //' * .added

Or even:

rename .sss .txt * .sss
mmv command

For Ubuntu use this command top get the software:

sudo apt-get install mmv

If you use CygWin on Windows, you'll need to install it with the installer:

mmv - rename multiple files

After that use:

mmv '* .added' '# 1'

If we want to rename the extensions:

mmv '* .html' '# 1.txt'

In this case I not renaming but removing the extension. But you can use them for renaming as well.

Under Windows use CygWin.