shell - rename filenames under a folder, make them shorter -


this question has answer here:

i have folder contains many .ass files subtitles of tv show file name long:

house.of.cards.s01e01.webrip.720p.h.264.aac.2.0-hoc.some-other-things.ass house.of.cards.s01e02.webrip.720p.h.264.aac.2.0-hoc.some-other-things.ass house.of.cards.s01e03.webrip.720p.h.264.aac.2.0-hoc.some-other-things.ass

now want change them shorter form:

house.of.cards.s01e01.ass
house.of.cards.s01e02.ass
house.of.cards.s01e03.ass

is there simple way it? (may via shell script)

thanks in advance

there (not so) simple way it

for f in *; mv "$f" "${f//.h.*/}"; done f in *; mv "$f" "$f.ass"; done 

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -