Hacker News new | past | comments | ask | show | jobs | submit login

Your tip is appreciated, but that pales in comparison to what you could do with vim or emacs and a tool like qmv when renaming files.

You could, for instance, rename by regular expressions, easily do block selections and substitutions, use complex macros, etc. The sky is really the limit.

Then there are unlimited undo features of modern editors, and even branching undo histories where you can get back to a state that would be unreachable with linear undos.

Finally, tools like qmv do sanity checking on your renaming plan, so that if you (for example) wind up renaming two files to the same name, it'll warn you and safely let you rename the original files and try again.

As a result of the power and safety these tools provide, I no longer rename directly using my shell's renaming features (like the ones you describe) except for the absolute simplest and foolproof situations. For anything more complex, I use qmv.




I appreciate the clarification. My comfort with shell (which is one of my primary languages for countless tasks) makes it a more viable option for me and blinds me to the issues many people have. That's definitely not the case for many people.

I can certainly recognize the power of what you are describing. Perhaps I'll give it a try in the future.

Out of curiosity: what do you find are your most compelling use cases for the tool(s)?


Hey Mike, I'm not the original poster, but I'm a good candidate to answer since I'm reasonably comfortable with the shell and I've been looking for a tool like Roamer/qmv specifically because of shortcomings in shell renaming (or my knowledge thereof). My most common case for this is renaming a batch of files to a different naming scheme. For example I was recently renaming 15 or so files that were named like "08/30/2017 John Smith 478939da-b172-4952-b428-d77c4f4f6674.doc" and I wanted them all to be named like "john-smith.doc". I did end up renaming them with the shell but through doing something like `for i in *; do { mv $i \`echo $i | tr '[A-Z]' '[a-z]' | tr ' ' '-'\` } done` (I don't have the final script anymore). Which is slower to write and less elegant than the Roamer/qmv approach. But I'm very curious if there's a better approach to this problem on the shell.


Emacs (w)dired can do that in a snap.


Yup, agree 100%! Using `wdired` was my introduction to "editor-based file-system editing". Maintaining an emacs setup for this feature is overkill though.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: