Say I have these files:
essay.aux essay.out
essay.dvi essay.pdf
essay.fdb_latexmk essay.tex
essay.fls essay.toc
essay.log ......
How do I rename them to:
new_name.aux new_name.out
new_name.dvi new_name.pdf
new_name.fdb_latexmk new_name.tex
new_name.fls new_name.toc
new_name.log ......
The problem is that they have different extensions rather than different names, so I cannot use answers from this question. Also, I'm on macOS which doesn't have a rename
command.
touch
some random files and do some experiments ;) – nalzok Feb 05 '18 at 12:30perl
, so the easiest way to do this is to install the File::Rename CPAN module, then you can use therename
script which is included as an example. It's the same perl rename script mentioned in many answers to similar questions on this site. It's more work up-front, but then you have the best file-renaming tool available for all future renaming tasks. – cas Feb 05 '18 at 14:41brew
already installed - and you should - just runbrew install rename
. This is not the same as theFile::Rename
script but was inspired by it. It seems to have many more command-line options, but is backwards compatible with therename
referenced here so frequently. – cas Feb 05 '18 at 14:55