I am trying to define a robust file naming scheme to be used across the systems I am using. I work in university labs and I deal with all the three major OS: linux, macos, windows. Therefore I'd like to stick on something that can be easily used for all major OS.
Currently my file/folder naming rule is very simple:
- only use lower case letters from the English alphabet, and numbers
- no spaces, use underscores (_) as separator
- anything else is forbidden
Although this is simple and works across systems, it is too restrictive.
For example many modern search file/folders tools having spaces within file names maybe convenient. In fact most of these tools if I search for "XXX YYY", the tool will look for all those files/folders having these two sequences in the file name. This is not the case without spaces.
Another example is music album. Most software have naming scheme like "Artist - AlbumTitle", "Artist - Year - AlbumTitle", etc.
My question are:
how dangerous are spaces in file/folder names? I was educated that to ensure good and easy maintainable system, it's better to avoid spaces. Is this really the case?
I have been always told that another good rule is to avoid dashes (-). But I realized that in the linux world for example, dashes are used all over the system. And for instance the ISO standard date is something like "2019-05-17".
What do you thing about these issues? I'd really love to learn what is your favorite file/folder naming scheme
Best Pietro
-rfon linux, the commandrm *will expand torm -rf fileA fileB folderC, whenfolderCwould not be deleted when there is no-rffile. And the file-rfitself is not deleted. Many windows programs use/for parameters, that is reserves anyway, but some use dashes as well or in addition. Spaces cause problems, because they need to be escaped and sometimes you need two or more layers to escape spaces and escape characters, causing headache for developers. – allo May 17 '19 at 08:42-is just faster. But see the answer by @grawity why they shouldn't be used at the beginning of a filename. And please, never ever use&;-) While this is allowed in Windows, it makes writing any sort of batch file a disaster. And yes, we have that in our corporate network... – Berend May 17 '19 at 08:56