vidir

Edit filenames in a text editor

TLDR

Edit filenames in editor
$ vidir
Edit specific files
$ vidir [*.txt]
Edit directory contents
$ vidir [path/to/directory/]
Use specific editor
$ EDITOR=[vim] vidir
Verbose mode
$ vidir -v

SYNOPSIS

vidir [-v] [files|directory]

DESCRIPTION

vidir opens a list of filenames in a text editor, where each line contains a number and a filename. Editing the filenames renames the corresponding files, and deleting lines removes them. All changes are applied when you save and quit the editor.This approach leverages familiar editor features like search-and-replace, macros, and multi-cursor editing for powerful batch renaming operations that would be tedious with individual mv commands.

PARAMETERS

-v, --verbose

Verbose output.
files
Files to edit.
directory
Directory to edit.

ENVIRONMENT

EDITOR - Editor to useVISUAL - Visual editor

EXAMPLE

Editor shows:

$ 1 file1.txt
2 file2.txt
3 old_name.doc
Edit to:
$ 1 document1.txt
2 document2.txt
3 new_name.doc

INSTALL

sudo apt install moreutils
sudo dnf install moreutils
sudo pacman -S moreutils
sudo apk add moreutils
sudo zypper install moreutils
brew install moreutils
nix profile install nixpkgs#moreutils

CAVEATS

Part of the moreutils package. Deleting a line removes the file permanently. Do not change the line numbers at the beginning of each line. Use -v to see what operations are performed.

HISTORY

vidir is part of moreutils by Joey Hess. It provides intuitive file renaming using familiar editor interfaces.

SEE ALSO

qmv(1), rename(1), mmv(1)