当下有许多 mp3 文件,文件名如下
1-music1.mp3
2-music2.mp3
3-music3.mp3
4-music4.mp3
5-music5.mp3
.....
10-music.mp3
如何批量去除前面的前缀。
天蓬老师2017-04-25 09:03:54
I misread the question, it’s about batch renaming
You can use the ls
和管道和rename
command
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
为情所困2017-04-25 09:03:54
rename 's/^.*-\(.*\.mp3\)//' *.mp3
This will delete the aaa- in the name aaa-bbb.mp3;