I would like to name my files and folders according to a specific date, e.g. 03.04.2016.
I see I can use them but are there any disadvantages to using periods in files or folder names?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.
Sign up to join this communityThey are valid and you can use them but yes, there are disadvantages.
A period is often used in regular expressions to represent a single character.
A period in filenames is often used as the standard separator between filename and extensions.
A period at the start of a filename is used to indicate configuration and/or hidden files.
For these reasons using periods in filenames for other purposes often leads to issues down the road with other command line functions and other tools and frameworks not expecting them and not working correctly.
Periods by themselves have no meaning, but what follows the period may have meaning to programs that look at the file suffix. For that, look at /etc/mailcap and /etc/mime.types
Some implementations of ls can sort by suffix as well, e.g.
ls -lX
for GNU coreutils.
touch), or making the names begin with a yyyymmdd pattern (no punctuation at all). But OP gave no hints for usage.
Apr 3, 2016 at 15:24
2015-12-31), which would make it easier to sort your directories chronologically using only their name..s are valid characters in file names (it's quite obvious they're valid chars).