Decimal mark in the file name

Is there a canonical way to write decimal places in a file name? Dots, commas, and apostrophe characters are problematic.

Forgive me if this was asked before, but I could not find anything like it. Perhaps I did not know how to look for him.

+5
source share
2 answers

Windows (7 probably refers to later versions)
Through experimentation, I discovered that you can name files using ".". in them until the file extension after the last ".". For example: ".qerg..docx" is a valid file name, and "..rwhg..docx". is not. Here I have a .txt file that I named "...":

screenshot

Macintosh OS 9
Decimal places are allowed, but colons (":") are not.
Macintosh OS X
The same rule as for Mac OS 9, however file or folder names cannot begin with decimal.
Unix
Characters that are not allowed in Unix file and folder names are slashes ("/") and NUL ("\ 0"), however in most Unix shells these characters (\? * | "<>) Must be escaped with a backslash , eg:
File name:

What is > life? 

You need to enter into the shell as:

 What\ is\ \>\ life\? 

Additional literature:
There is a useful Wikipedia article about your question here.

+4
source

Put the file name in quotation marks:

 $file="abc.def" 

Or use an escape character (which is OS dependent)

 copy data.txt to qwe\.rty 
+1
source

Source: https://habr.com/ru/post/1242754/


All Articles