Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

How to rename files using ViDir

📅 2014-Sep-11 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ vidir ⬩ 📚 Archive

If you are comfortable using capable editors like Vim, then you might like to do mass file renaming using them instead of specialized GUI tools. The unique ViDir tool enables you to do just that.

To get it, install the moreutils package:

$ sudo apt install moreutils

To rename files in a certain directory, invoke the program in that directory:

$ vidir

It now opens a text file in your default editor showing a list of the files in this directory. To rename the files, just rename their filenames displayed in the editor! You could use the powerful find-replace or regular expression features available in your editor to achieve this with ease. Once you save the file and exit the editor, vidir renames those files to the names you specified! It is that simple and works like magic!

Tried with: MoreUtils 0.5 and Ubuntu 14.04


© 2022 Ashwin Nanjappa • All writing under CC BY-SA license • 🐘 @codeyarns@hachyderm.io📧