Except the max length of a filename (1023 chars for ZFS, I guess, but I'm not sure, since today's filesystems allow way longer filenames than what I see is practical) and which characters are not allowed to be used in a filename - I don't find the convention quickly. Almost all characters are allowed but a few exceptions, like e.g. NULL - it's not the point if the filesystem gets harmed, nor the file could get lost.
The point is that UTF-8 and some certain characters can cause troubles in other ways.
Example: ? is a valid character to be used in a filename. Since it's also a wildcard you can quickly see it's no good idea to have such in a filename.
Also the need to escape special characters like writing '\ ' instead of ' ', and paranthesis and others can cause trouble.
So, it's no actual rule but many people including myself don't use spaces and other chars in filenames, but replace them e.g. with _ or -
When I name files myself I only use a-z A-Z 0-9 _ - and .
Unix filenames are case sensitive:
text,
Text and
TEXT are three different independent filenames can be used in the same directory at the same time. In fact filenames are for human users. For the filesystem the file's inode number is the "true" filename:
ls -i. Having the same inode means it's exactly one and the same file, no matter how it's named (also see
ln(1).)
I find that's fully sufficient to name files so they can be identified unequivocally. Filenames are not to be confused with the content of a file, like the headline of a paper. As long as you don't use some ancient FAT limited to 8.3 chars for a filename, there is enough space to say in normal characters what a file is.
You already know it, but under BSD it's neither mandatory nor needed but very useful so also common to let all filenames end with .xyz to see directly, what kind of file it is: .txt textfile, .sh shellscript, .c - you get the picture.
I also prefer lower case letters on my production files. It's simply practical reasons. Since I do most of my work and 100% of all filehandling in the shell it's less effort to avoid pressing the shift key all the time.
Within my
/home/ and all its subdirectories all directories start with a unique letter. There is one directory
/home/files/programs and one
/home/files/Playlists but no other directory or filename starting with P or p in
/home/files/. Lower case letters for the more frequently used ones. I find this pretty handy, since I only need to press one button and let shell's autocompletion do the rest.
Prefix a date I also do, but only on documents. Documents in the meaning of documents, not this fancy MS Windows meaning. Files that are not going to be changed anymore but for which I need to have a timestamp safe from the filesystem's one, when a chronological order is more important than alphabetical, in other words: letters, invoices, official stuff. Then I use YYYYMMDD-, this way they are sorted chronologically by filename. Some could say, 'YYYY is optimistic. YY is enough.' Sure, but I'm not 40 anymore. I still have stuff from the 1990s.
For all other files the filesystem's file's timestamp is enough for me to know. Naming all and each file YYMMDD- I personally do not find practical in daily use, not creating more clearness for me in a directory. But that's 100% personal taste, of course.
Note (from man ls):
Code:
If the modification time of the file is more than 6 months in the past or
future, and the -D or -T are not specified, then the year of the last modi-
fication is displayed in place of the hour and minute fields.
This can cause a bit confusion for newbies, particulary when New Year fells in those 6 months.
Anyway my recommendation is to always give files a considered name.
I admit, it's not easy to always find a good name as long as needed, but as short as possible. But my advice was to give the thought rather a minute more than later to regret gave a poor name.
Naming a file
hw.c instead of
hello_world.c will cost you later way more time than what you saved by not thinking of a better filename. You'll see, when in a couple of months you stumble over it and try to remember and finding out what this thing is. It's also obvious that
This_is_my_very_first_C_program-hello_world.c or
XZGHHT46W57485 are also suboptimal for practical usage.
Some thing named
test I also do, but when I forget to remove that garbage right after the test and then stumble over it a few weeks later, 'what the ...?' - those can really trash up your place.
Using a system a while and your
/home/ will fill up with
a lot many files. So considering a good system how to name and sort files, above all make use of and look for a considered system of subdirectories, in the first place is way -
WAY - less effort, than face the situation to clean up a trashed up place afterwards.
Particulary nobody fancies cleaning up, keep more order in the first place is always less effort than cleaning up afterwards. Keep order = no fun. Cleaning up = even less fun.
Tip: Always directly remove files not needed anymore. When deinstalling a package you installed just to take a look at it, always directly afterwards also remove its config files in your
/home/ again.
Tip: Check out some
ls(1) options. You also can get a lot more overview of a directory's content than by just using considered filenames when instead plain
ls you do for example
ls -gh,
ls -lSh, or particulary I love the
-t option:
ls -gat. I just need to look at the top of the list to see quickly only the files changed recently, not scanning the whole directory's full list. It's my very personal taste I prefer single column lists. That's why my examples all contain
-l or
-g.
Tip: In your shell's config file (
~/.shrc for bourne shell,
~/.cshrc for [t]csh) are by default aliases defined for quick ls command usage. Feel free to change those to your personal taste, or add own ones.
Anyway, you define and decide what's practical for you.
When I get a file from somewhere else, particulary Windows, I replace all characters not matching my convention: ()[]{}:#?!'`´"%& etc. also use Ae instead of Ä, oe instead of ö, etc (when your not dealing with English only you have to deal a lot with "exotic" characters.)
Since this is one of the more freqent tasks, especially when moving a lot of files from Windows to FreeBSD, or to be more correct from NTFS to ZFS or UFS, I have written me a tiny, simple shellscript that automatically replaces/removes unwanted chars from filenames. Just run it in a directory with files with weird names and voilá, all filenames are nice and don't contain no ugly garbage no more.
Hannes Kretzer - Devotion & Decay (official video) [RLKHiW_7XZM].mp4 
becomes
Hannes_Kretzer-Devotion_and_Decay-official_video.mp4
(Hannes Kretzer is the musician who made the soundtrack of Avorion. Alas after several upgrades the game eventually sucked, but the music is very meditative. I find it very nice for background while working.

)