DEV Community

Itachi Uchiha
Itachi Uchiha

Posted on

Renaming File Names That Contains Date

Hi there. I have a lot of files contains date format in their name. I wanted to remove that dates from that files. I wrote the bash script belove. You can use this script. It works 🙂

My files was like that;

Btw, customize it for yourself.


# description: Your files should be like that;

for i in *.md
    mv $i $(echo $i | sed -E 's/([0-9]{4}-[0-9]{2}-[0-9]{2}-)//')
Enter fullscreen mode Exit fullscreen mode

What would your approach to this be? How would you solve it?

Top comments (0)