by em-bee · 8y ago · 0 comments
however, i miss one feature for which i'd use a filemanager: in-place file renaming. in most cases when i want to rename a file, i want to change a small part of it, and i don't want to have to retype the whole filename.
i have yet to find a commandline utility (emacs doesn't count ;-) that offers that.
e.g.
mv /path/to/file{-old-name,-new-name}.txt
which expands to: mv /path/to/file-old-name.txt /path/to/file-new-name.txt
So use tab completion to get your path then go back and stick your curly brackets into it as needed. Oh and it works for things like git branch renaming or anything else you do in the terminal.but now i'll become good friends with qmv
greetings, eMBee.
It also comes with qmv, which will pop open an editor for you to perform inplace edits on filenames. Which is kinda like dired as an emacs comparison, at least if you squint an awful lot.
qmv even handles swapping filenames which ranger doesn't.
greetings, eMBee.
Of course, you could get more advanced with parameter tricks, eg. ${i%.ps}.pdf for changing the extension of $i from ps to pdf. (Technically: truncating the ending iff it matches ".ps" and adding ".pdf" no matter what.)
rename 's/foo/bar/' *.ext
Of course you have to know Perl...