1

This question already has an answer here:

What is the difference between ls -l and dir -l?

I always use ls -l, but my colleague (who is slightly colour blind) uses dir -l. Is this the only difference: ls -l has colour and dir -l not have colour? Or is there a benefit of using dir instead of ls?

marked as duplicate by Ramesh, cuonglm, jofel, terdon Sep 17 '14 at 16:18

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

4

From the dir info page:

dir is equivalent to ls -C -b; that is, by default files are listed in columns, sorted vertically, and special characters are represented by backslash escape sequences.

ls doesn't have color by default but only when it is called with e.g. --color=auto or the environment variable LS_COLORS is set. Usually the command ls is an alias/macro which calls ls with the --color option.

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