Thursday, May 2, 2024
 Popular · Latest · Hot · Upcoming
46
rated 0 times [  46] [ 0]  / answers: 1 / hits: 75061  / 1 Year ago, sun, january 29, 2023, 7:34:26

Sometimes it makes practical sense for a folder name to contain a dot (.). For example, you are storing data for an experiment conducted at L=0.5. So the folder might be named:


experiment_L0.5

A similar issue may arise for file names. For example:


file_L0.5.txt

Working in Ubuntu, is this bad practice? What about sharing these directories with a Windows user?


More From » files

 Answers
4

As far as I know there are no issues with naming folders and files with a single or multiple dots.


Ubuntu generally does not use the dot and three characters (such as .txt) to identify the file type. So this has no special meaning in the Ubuntu context. This is useful when sharing files with Windows. Ubuntu uses Magic Numbers in the first few bytes of the file to identify the file type. However, Nautilus ignores the magic numbers if the dot and three characters extension is available to identify the file type. This setting can be changed. See Force nautilus to ignore extensions


In Ubuntu, starting a file or folder names with a dot, such as .experiment_L0.5, makes the file or folder hidden. You can toggle the display of hidden files by pressing Ctrl+H in Nautilus. In Windows a file name starting with a . in front of it is not hidden. So if you transfer a hidden file named .experiment_L0.5 into a Windows system, it will be plainly visible.


In Ubuntu a file name can end with a dot, as it has no special meaning placed at the end. However, in Windows a dot separates the file name and extension, and a file name ending with a dot but no extension is not allowed. When I tried to create such a file in Windows I got a file with just the name, no dot, no extension.


Reference: Wiki on Filenames


Hope this helps.


[#27210] Monday, January 30, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
sconhoney

Total Points: 403
Total Questions: 118
Total Answers: 109

Location: Andorra
Member since Mon, Jan 9, 2023
1 Year ago
;