Created
May 25, 2026 20:44
-
-
Save copyleftdev/9bef7774a64846eec82f8032f545b95d to your computer and use it in GitHub Desktop.
vidir — rename or delete a batch of files in your text editor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # vidir — edit a directory listing in $EDITOR (from moreutils) | |
| # sudo apt install moreutils | |
| vidir directory/ # open all files in editor | |
| ls *.sh | vidir - # open a specific subset | |
| # In your editor: | |
| # - Edit a path → renames the file | |
| # - Delete a line → deletes the file | |
| # - Change directory prefix → moves the file | |
| # - :%s/old-/new-/g → bulk rename all matching files | |
| # Replaces: | |
| # rename 's/pattern/replacement/' * (requires remembering Perl regex) | |
| # for f in *; do mv "$f" "new-$f"; done (requires careful quoting) | |
| # With: open editor, edit text, save. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment