Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?
share|improve this question
add comment

2 Answers

up vote 5 down vote accepted
  • 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..
share|improve this answer
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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