DEV Community

Discussion on: How to rename all md files to mdx

Collapse
 
bestspacejam_34 profile image
bestspacejam

More safer solution from Stack Overflow answer:

find ./posts -name '*.md' -print0 \
  | sed -z 'p;s/md$/mdx/' \
  | xargs -0rn2 mv --
Enter fullscreen mode Exit fullscreen mode

Use -print0 is necessary for processing file names with newlines.