0

I have a folder with ~30 files. The are already BitTorrent metafiles that lack a .torrent suffix. I want to change all those files to .torrent files. How would I do that? In windows it was as easy as typing

ren *.* *.torrent

while being inside the folder with all those files.

I am not sure what the current file extension of those 30 files is.

Appreciate any help!

3 Answers3

1

If you can install rename:

sudo apt install rename

Try:

rename 's/\.[a-zA-Z0-9]{1,}$/.torrent/' *.*

On another note, remember changing file extension won't change its file type or contents.

1
for file in *; do
  base=`echo "${file%.*}"`
  mv -- "${file}" "${base}.torrent"
done

Worked for me!

0
sudo apt install krusader krename

Krusader has a menu for File-MultiRename on selected files in it's browser, which browser also can be filtered . krename can also be used in terminal and it's own gui when run without parameters.

pierrely
  • 725