0

I have a file that I want to rename to a date like "20/02/21", but if I do mv file.txt 20/02/21 it interprets the forward slashes as referencing sub-folders. Is there a way to do this?

gkeenley
  • 6,088
  • 8
  • 54
  • 129
  • 2
    Duplicate: [Is it possible to use "/" in a filename?](https://stackoverflow.com/questions/9847288/is-it-possible-to-use-in-a-filename) Short answer - you can't do that. – Carl Norum Feb 28 '21 at 17:59
  • @gkeenley : See [here](https://www.lemoda.net/unix/filename-chars/index.html). – user1934428 Mar 01 '21 at 08:50

1 Answers1

0

No, there's no way to do it. On Unix forward slash / is used to separate directories and cannot be used in the filename. You have to use another delimiter - 20\02\21, 20-02-21, 20.02.21 etc.

Arkadiusz Drabczyk
  • 11,227
  • 2
  • 25
  • 38