0

I trying to modify a lot of files with names like 2020-06-28 16.19.50.md, removing the spaces and symbols, retain only the first 12 digits as 202006281619.md.

Hopefully this can be done with a shell script through Regular Expressions. Selecting these files in the macOS Finder, right-click and run the Service script to complete the changes.

Joey
  • 11
  • 1

1 Answers1

0

I don't use Regular Expressions. But this can remove spaces of current directory's file names.

for f in *; do mv "$f" "$(echo $f | sed 's/ //'g)" ; done
Yuji
  • 525
  • 2
  • 8