Skip to content
/ emv Public

POSIX script to move/rename/remove files with your $EDITOR.

License

Notifications You must be signed in to change notification settings

invarianz/emv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

(E)ditor (M)o(v)e → emv

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

Installation

Copy emv to a directory on your $PATH, for example:

cp emv /usr/local/bin
chmod +x /usr/local/bin/emv

Ensure that $EDITOR is set (defaults to vi if unset).

Anatomy of the filename list

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.copen_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.

Usage

  • emv: Opens the editor on the current directory's file-list: Opens the editor on the current directory's file-list.

Before and After

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

About

POSIX script to move/rename/remove files with your $EDITOR.

Resources

License

Stars

Watchers

Forks

Languages