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.

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
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

Your Answer


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.