2

It seems like the general pool of logging, changelog, readme, and config files in Linux is very inconsistently named. It always makes me wonder, why didn't *nix devs decide on a common file name schema long ago? I feel that it's unnecessarily annoying having to remember exactly how a file is named in regards to, let's say, configs.

For example, here is the configuration naming convention: We find this, this.cnf, this.conf, this.config, or neither, dropping into the underscore this_config realms, or even occasionally the Windowsy this.cfg style. Considering the diversity above, what is the most accepted approach for naming configs? The same can be said/asked for logs, changelogs, readmes, etc.

Most of the scripts and binaries seem well laid out with consistent schema, so what made configs take the hard road? Did something happen back in the day that divided the dev crowd into naming convention camps, or was "tertiary" consistency like this just never worth pursuing due to the open nature and free spirit approach of Linux?

dhaupin
  • 146
  • I'm expecting a lot of "from the hip" "if it ain't broke don't fix it" style downvotes. Don't be ignorant, take the time to explain why you chose a vote down. – dhaupin Aug 11 '15 at 20:42
  • 1
    I'm guess more along the lines of "too broad" no specific answer is possible. Or just "of course you can't herd cats." Some devs came from different OS backgrounds, or even originally wrote their software on different platforms. I'm upvoting since this got a nice answer that points out that .conf is the most common these days. (It's true esp. in /etc, less-so in ~/*.whatever) – Peter Cordes Aug 11 '15 at 21:13

2 Answers2

4

Considering the diversity above, what is the most accepted approach for naming configs?

Whatever you want to call them. File extensions don't matter much beyond letting an admin know what the file probably is. A human is probably going to know that *.cfg and *.conf are both probably config files.

The *.cnf I've only ever seen with MySQL which is a one-off deviation that you'd have to ask the MySQL/MariaDB developers about.

Did something happen back in the day that divided the dev crowd into naming convention camps, or was "tertiary" consistency like this just never worth pursuing due to the open nature and free spirit approach of Linux?

It's probably not something most people would consider important. Most people go with *.conf nowadays (nginx, udev, apache, rsyslog/syslog-ng, etc), but it's possible *.cfg was preferred back when file paths could only have a few characters. It probably never changed for the same reason /etc/fstab was never renamed, most people who cared already know what the file in question does.

Bratchley
  • 16,824
  • 14
  • 67
  • 103
  • Aye agree on the human factor, and i also feel .conf is most common. But that's precisely the point for all the old stuff too: if it's strictly for human readability and offers no runtime advantage, why not make it easiest (or shortest) to read, in a most consistent manner? Its so hard to remember whether there is or is not an o when you wrap your head around the thousands of them. There are a couple more rando .cfgs out there too, ie /usr/share/autoconf/autom4te.cfg – dhaupin Aug 11 '15 at 20:48
1

Did something happen back in the day that divided the dev crowd into ... camps ...?

You may be looking at the chronology backwards.  "Back in the day" the "Unix dev crowd" was all at AT&T Bell Laboratories.  (If you provide enough power to the flux capacitor, you may be able to go back to a time when the "Unix dev crowd" was two people, and they may have shared an office, for all I know.)  But then the University of California (Berkeley)  (and other less well known universities) started modifying it, and companies like IBM, Sun, and Oracle got into the act (producing products like Xenix, AIX, and Solaris), and that's not even counting all the companies (e.g., Sybase) that just wrote application software for Unix.  (See What exactly is POSIX? for more background/history on Unix/POSIX.)

These developers (1) didn't know what each other were doing, because they were working for competing organizations, (2) thought their way was better, and didn't care about giving the user a uniform experience, and/or (3) deliberately chose to be arbitrarily incompatible, for purposes of fragmenting the market.  (It's been suggested that IBM strategically made the Unix market a jungle in order to drive customers away from Unix and back to their proprietary operating systems.)  This is just a fraction of the legacy of Linux.

So why hasn't this been "fixed"?  Well, as you said yourself, "If it ain't broke, don't fix it."  And backward compatibility within products (e.g., mySQL) may be considered more valuable than horizontal compatibility between products.