For regular *.txt text files that contain documentation and notes and such, and which are not READMEs, is there a Unix convention for naming them? Namely,

  • Should the filenames be all lowercase? camelcase? all caps?
  • Should words separated by hyphens, underscores, or escaped spaces?
  • Should short names be favored over longer, more explicit ones?
  • generally, unix prefers lowercase, definitely NOT all caps, READMEs are a special case and are uppercase (as with other special files like COPYING, LICENSE, etc..) - but otherwise, general (or "regular" as you call them) text files should not use uppercase.
  • either hyphens or underscores, avoid spaces - even escaped
  • somewhere in the middle: short enough that you can read it quickly and not waste space on your screen, but not so long that it will wrap around in a gui..

I generally use *.txt for general text files, out.build.NN for output from a build, *.lst for a newline delimited sequence that'll be fed into a program (like xargs) and programname.log for output from long-running programs. And I use a lot of numbers (a'la out.build.NN) if I will be successively running the same program multiple times. But this is just my own convention.

I generally use lowercase since that is most common in UNIX/Linux. I use hyphens, underscores and periods and stay away from "special characters" (like space, tab, return char). The size of the filename depends on what you are trying to get. If you'll have file for a long time, it may be better to have a slightly longer filename to help remember it's purpose.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.