# Rename files (content/\*.md)

**URL:** https://discourse.gohugo.io/t/rename-files-content-md/41497
**Category:** support
**Created:** [November 17, 2022, 10:34am UTC](https://discourse.gohugo.io/t/rename-files-content-md/41497 "2022-11-17T10:34:49Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![AucT](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/auct/32/5272_2.png) [@AucT](https://discourse.gohugo.io/u/AucT)
#### Post date: [November 17, 2022, 10:34am UTC](https://discourse.gohugo.io/t/rename-files-content-md/41497/1 "2022-11-17T10:34:49Z")

</div>

Is there any cli command to rename all content files to Y-m-d\_slug.md ?

If not it is my suggestion to create.

---

<div class="post-metadata">

### Author: ![chrillek](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/chrillek/32/19797_2.png) [@chrillek](https://discourse.gohugo.io/u/chrillek)
#### Post date: [November 17, 2022, 11:02am UTC](https://discourse.gohugo.io/t/rename-files-content-md/41497/2 "2022-11-17T11:02:30Z")

</div>

That’s the job of utility commands like `mv`, which I suggest you use for that purpose. It has nothing to do with Hugo

---

<div class="post-metadata">

### Author: ![AucT](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/auct/32/5272_2.png) [@AucT](https://discourse.gohugo.io/u/AucT)
#### Post date: [November 17, 2022, 11:12am UTC](https://discourse.gohugo.io/t/rename-files-content-md/41497/3 "2022-11-17T11:12:07Z")

</div>

that’s right. but also it would be usefull if hugo has.  
making php script file for it 😛

---

<div class="post-metadata">

### Author: ![AucT](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/auct/32/5272_2.png) [@AucT](https://discourse.gohugo.io/u/AucT)
#### Post date: [December 11, 2022, 3:45pm UTC](https://discourse.gohugo.io/t/rename-files-content-md/41497/4 "2022-12-11T15:45:38Z")

</div>

if someone need this I’ve published gist.

copy this script to hugo content/posts folder and run php rename\_files.php and you will get nicely named files with date prefix

> <https://gist.github.com/AucT/b6120f937ac59d6e4a08848562b5fb65>

.p.s. I still think hugo should have this functionality

---

<div class="post-metadata">

### Author: ![system](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/system/32/1_2.png) [@system](https://discourse.gohugo.io/u/system)
#### Post date: [December 13, 2022, 3:46pm UTC](https://discourse.gohugo.io/t/rename-files-content-md/41497/5 "2022-12-13T15:46:17Z")

</div>

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
