Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

hajime

macrumors 604
Original poster
Jul 23, 2007
7,922
1,312
I think many years ago some mentioned that it was not a hood idea to do that. Which OS has issue with this naming format? What about MacOS for the past 10 years?
 
Last edited:

AZhappyjack

Suspended
Jul 3, 2011
10,183
23,657
Happy Jack, AZ
I think many years ago some mentioned that it was not a hood idea to do that. Which OS has issue with this naming format? What about MacOS for the past 10 years?
I've never had a problem with filenames starting with number... I typically name important files YYYY-MM-DD-descriptive-name.ext ... and have done so since I started using computers almost 40 years ago... where did you hear that this was problematic?
 
  • Like
Reactions: adrianlondon

DeltaMac

macrumors G5
Jul 30, 2003
13,761
4,587
Delaware
I used to (some years ago) organize file and folder groups by starting filenames with specific numbers.
Worked, but I decided it was not worth doing when I needed to contend with other users who needed to access some of those files, and had to follow a chart to find files.
So, it worked, but I abandoned that kind of file identification. :cool:

Maybe what you remember is about a few symbols? It's not a good idea to randomly begin a file name with a dot (.) (never has been a good choice on a Mac :D )
 

MacCheetah3

macrumors 68020
Nov 14, 2003
2,286
1,228
Central MN
hajime said:
Is there a problem starting the filename or foldername with a number?
Offhand, I don’t recall any such requirement for file names.

Many software languages (I.e., computer programming) will not allow variables and constants to begin with a numeral or include most special characters.

With that said, @DeltaMac has a valid point regarding use of the period in file names. Best practice is to only use a period to include a file extension. There are special use cases, such as beginning a name with a period in macOS/Mac OS X to make the file/folder hidden.

Best practice and requirements for file/folder names in general:

• Some special characters are not allowed
• You shouldn’t begin a file/folder name with a special character — again, there are special use cases
• Do not include spaces in file names that involve the Web (content or will be provided as downloads)
— This rule also applies if using CLI
• Only use hyphen/dash ( - ) and/or underscore ( _ )

EDIT: Made corrections and attempted to improve clarity
 
Last edited:

ssmed

macrumors 6502a
Sep 28, 2009
885
423
UK
Not numbers – we start all of our office files with the date in 20XX-MM-DD format and have done for a long time.
 

Boyd01

Moderator
Staff member
Feb 21, 2012
7,952
4,888
New Jersey Pine Barrens
Can't ever recall having a problem with numbers, have done it as long as I can remember. I build mapping websites that consist of (literally) millions of 256x256-pixel image tiles that have only numbers for names. No problems whatsoever.

Would be a big problem if you couldn't start a filename with a number. I got my first Mac in 1985 and doubt this was ever an issue.

Screen Shot 2021-06-14 at 7.04.21 AM.png
 

Ritsuka

Cancelled
Sep 3, 2006
1,464
969
No, the only character you can't use is / (and in Finder ":" because the classic Mac OS used it as the path separator, and Finder does some weird conversion to /).
 
  • Like
Reactions: Boyd01

dwig

macrumors 6502a
Jan 4, 2015
908
449
Key West FL
There are OSs with more restrictions in filename. The requirement that a filename begin with an alphabetic character has existed, but is very rare and is outside of the personal computer world. There have been other restrictions on first characters over the eons. Check out:

Wikipedia: Filenames

Good practice requires that filenames be limited to what works reliably on common OSs and media formats. That means Linux, Windows, Android, iOS/iPadOS, and macOS and with FAT32, ExFAT, NTFS, HFS+, APFS, and ISO-9660 (CD/DVD). It is also important that various applications' handling of filenames be taken into consideration.

I've encountered issues with leading spaces in filename when moving files from macOS to Windows. Windows had no problems, nor did macOS and Adobe Lightroom on macOS. The failure was in Lr on Windows not dealing with leading spaces properly when importing a catalogue exported from the Mac version that contained files and/or folders with leading spaces in their names. These days I use leading underscores instead of spaces when I want to force the order files/folders appear in Finder.
 
  • Like
Reactions: hajime

Mousse

macrumors 68040
Apr 7, 2008
3,652
7,091
Flea Bottom, King's Landing
Maybe what you remember is about a few symbols? It's not a good idea to randomly begin a file name with a dot (.) (never has been a good choice on a Mac :D )
That's a *nix convention--makes the file hidden. OSX is based on Unix.

I don't use special characters in my file name because some OS don't fancy that. I've used too many different OS'es in the past that I try to keep my naming as universal as possible.
 
  • Like
Reactions: Amethyst1

Blue Quark

macrumors regular
Oct 25, 2020
196
147
Probabilistic
I decided to experiment with this first before posting anything.

A full colon is, naturally enough, forbidden. Forward and back slashes are fine. An asterisk is fine, so long as you do not precede it with a period, because then it thinks you're trying to put a file extension on, and so it will prompt you if you want to do that. No other characters often used as operands (+, -, ?, |) are restricted, and I kind of randomly tried a bunch of other things, and couldn't find any other restrictions.

I haven't dabbled with Btrfs, but the ext series is the only other filesystem as non-restrictive as HFS/HFS+ and APFS, in my experience.

And no, there's no "first character of the file name" restrictions. If you want to use numbers, use away!
 

panjandrum

macrumors 6502a
Sep 22, 2009
732
919
United States
Not sure exactly *why* you are wanting to do this, but if you are simply trying to bump things up to the top of 'sort alphabetically' list then what you can do as an alternative is use space-characters in front on a file or folder name. The more spaces the further in advance of "A" the file/folder will be sorted. It's also OK to use a number of special characters and the MAC can handle it fine (option+8 for a bullet character, for example) to also change sorting order. This is really handy if you like to sort alpha but want to bump a few items to the top all the time.

But as others have pointed out, it's a very, very good idea to avoid any character prohibited on any commonly used operating system even if they work fine on your Mac as they can cause major issues if those files ever end up on a different OS.
 

hajime

macrumors 604
Original poster
Jul 23, 2007
7,922
1,312
There are OSs with more restrictions in filename. The requirement that a filename begin with an alphabetic character has existed, but is very rare and is outside of the personal computer world. There have been other restrictions on first characters over the eons. Check out:

Wikipedia: Filenames

Good practice requires that filenames be limited to what works reliably on common OSs and media formats. That means Linux, Windows, Android, iOS/iPadOS, and macOS and with FAT32, ExFAT, NTFS, HFS+, APFS, and ISO-9660 (CD/DVD). It is also important that various applications' handling of filenames be taken into consideration.

I've encountered issues with leading spaces in filename when moving files from macOS to Windows. Windows had no problems, nor did macOS and Adobe Lightroom on macOS. The failure was in Lr on Windows not dealing with leading spaces properly when importing a catalogue exported from the Mac version that contained files and/or folders with leading spaces in their names. These days I use leading underscores instead of spaces when I want to force the order files/folders appear in Finder.
Yes, we do need to consider possible issues moving to different OS.
 

Boyd01

Moderator
Staff member
Feb 21, 2012
7,952
4,888
New Jersey Pine Barrens
What operating system would you move to that doesn't allow filenames to be numbers? As @dwig said, there might be some historical example of this, but nothing you will encounter today. It certainly isn't a problem for MacOS, Windows, Linux, unix, iOS or Android.

People have pointed out that there are some other special characters that might create problems, but you asked: "Is there a problem starting the filename or foldername with a number?". IMO, the answer to that question is definitely "No". And there's no need to justify why you want to do this, it's your computer, your files, name them whatever you like. :)
 

dwig

macrumors 6502a
Jan 4, 2015
908
449
Key West FL
Yes, we do need to consider possible issues moving to different OS.
An addenda to my earlier post: An addition to the filesystems that need to be considered, URI/URL limitations should also be considered when following "best practice" since often these are built up from folder and filenames.
 
  • Like
Reactions: MacCheetah3
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.