emv is a simple, fully POSIX-compliant shell script that lets you
interactively rename or delete files in your current directory using your
preferred $EDITOR.
- Goals: Keep it short, simple, and POSIX-compliant
- Non-Goals: Bulk or recursive renaming, pattern expansions, handling filenames with embedded newlines
Copy emv to a directory on your $PATH, for example:
cp emv /usr/local/bin
chmod +x /usr/local/bin/emvEnsure that $EDITOR is set (defaults to vi if unset).
When you run emv, it snapshots the directory, e.g.:
README.md
confidential_source_code.c
unused_logfile.log
draft.txt
That list is opened in your editor for you to:
- Rename: edit a line (e.g.
confidential_source_code.c→open_source_code.c) - Delete: clear a line entirely to remove that file (keep the empty line!)
(e.g.
unused_logfile.log→)
Save and exit to apply your changes.
emv: Opens the editor on the current directory's file-list: Opens the editor on the current directory's file-list.
We use the filename list mentioned above and apply the suggested changes inside
a $EDITOR session.
README.md
open_source_code.c
draft.txt
Save and quit.
Execuitng ls -1pA in the active directory will show:
README.md
open_source_code.c
draft.txt