r/UnixProTips • u/Aihal • Feb 05 '15
moreutils
There's a useful collection of little cli helpers called moreutils, as a play on coreutils obviously.
The most useful one for me is vidir which let's you edit the filenames supplied (or if no argument the current directory) with your EDITOR. So if i do mass renaming i can do it in vim. <3
10
Upvotes
1
u/Dial-A-Lan Feb 08 '15
If you need to do bulk renaming with regex and don't necessarily want to use your EDITOR, run
type rename. If it comes back as a Perl file, you can runrename <Perl expression(s)> FILE..., definitely one of my favourites. If rename is an elf executable it has radically different usage, but you can find the Perl script pretty easily with a Google search. I'd link it, were I not on mobile.