mongodb - bash 批量重命名
黄舟
黄舟 2017-04-25 09:01:54
0
4
858

当下有许多 mp3 文件,文件名如下

1-music1.mp3
2-music2.mp3
3-music3.mp3
4-music4.mp3
5-music5.mp3
.....
10-music.mp3

如何批量去除前面的前缀。

黄舟
黄舟

人生最曼妙的风景,竟是内心的淡定与从容!

reply all(4)
Peter_Zhu

I misread the question, it’s about batch renaming
You can use the
ls和管道和renamecommand
for batch renaming Similar to the following batch delete command.

ls | grep "^[0-9]{1,2}-music.mp3" | xargs -d"n" rm
http://superuser.com/questions/392872/delete-files-with-regular-expression

给我你的怀抱

perl-rename 's/prefix/replacement/'

phpcn_u1582

for i in $( seq 1 10 );do
mv $i-music$i.mp3 music$i,mp3;
done

为情所困
rename 's/^.*-\(.*\.mp3\)//' *.mp3

This will delete the aaa- in the name aaa-bbb.mp3;

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template