Sign up ×
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.

When you are naming files with multiple words in the name, is it more common in Unix systems to use underscores, camel case, or dashes to separate the words?

share|improve this question

closed as too broad by slm Jun 12 at 1:06

There are either too many possible answers, or good answers would be too long for this format. Please add details to narrow the answer set or to isolate an issue that can be answered in a few paragraphs.If this question can be reworded to fit the rules in the help center, please edit the question.

When I'm naming them? Space. – Random832 Sep 24 '12 at 15:34
Traditional Unix commands and files don't tend to have more than one word at all. Most are a few letters. For your own files it is really up to you. I avoid spaces because they are a pain to deal with on the command line. The POSIX portable file name character set is quite restricted: alphanumeric, dot, underscore, and dash. – jw013 Sep 24 '12 at 15:39
As opposed to which naming method? – Karlson Sep 24 '12 at 16:38
This question may be interesting. – Francesco Turco Sep 24 '12 at 19:46

1 Answer 1

On one of my random systems:

$ find /usr/bin -xdev -type f -name '*-*' | wc -l                # hyphen
$ find /usr/bin -xdev -type f -name '*_*' | wc -l                # underscore
$ find /usr/bin -xdev -type f -name '*[a-z][A-Z][a-z]*' | wc -l  # camelcase
$ find /usr/bin -xdev -type f -name '* *' | wc -l                # space

Your mileage may vary. There's a lot of personal preference involved -- my home directory is probably very much skewed towards hyphens, because underscore and camelcase involves shifting, and space has difficulties with quoting.

share|improve this answer

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