I need to rename multiple files, and some tutorials shows that the command rename
is the best option instead of just use mv
for each file.
But then I have these files:
ReconhecimentoImagens2021-10-18--2020-2.mp4 ReconhecimentoImagens2021-11-01--2020-2.mp4 ReconhecimentoImagens2021-11-22--2020-2.mp4
ReconhecimentoImagens2021-10-25--2020-2.mp4 ReconhecimentoImagens2021-11-08--2020-2.mp4 ReconhecimentoImagens2021-11-24--2020-2.mp4
'ReconhecimentoImagens2021-11-01--2020-2(2).mp4' ReconhecimentoImagens2021-11-17--2020-2.mp4 ReconhecimentoImagens2021-11-29--2020-2.mp4
and just for a test I tried this command:
rename 's/2021/ /' *.mp4
and NOTHING happens, I get code 4 that according to the man page means 'nothing was renamed'.
I searched for multiple tutorials and nobody seems to be doing anything different than that so, what am I doing wrong here?
rename
command. Could you state yours?prename
,perl-rename
,file-rename
)? or some other rename (like the one in theutil-linux
package)? Find out by runningrename -V
- if it mentions perl or File::Rename at all (e.g./usr/bin/rename using File::Rename version 1.30, File::Rename::Options version 1.10
) then it's the perl rename. If not, then it isn't - and has completely different capabilities and options. If you're using some other rename, I recommend installing and using the perl rename (e.g. on Debian and related distrossudo apt-get install rename
).prename
orfile-rename
or similar.rename util-linux 2.37.2
@cas @FelixJNman rename
to figure out how to use it (it won't be anything likerename 's/2021/ /' *.mp4
) or (highly recommended) install the perl rename utility.