3

When I check the coreutils, I found that GNU Coreutils

10 Directory listing
This chapter describes the ls command and its variants dir and vdir, which list information about files.

• ls invocation:        List directory contents.
• dir invocation:       Briefly ls.
• vdir invocation:      Verbosely ls.
• dircolors invocation:     Color setup for ls, etc.

dir and vdir is just appended to coreutils as an alternative of ls,

What's the purpose of such a setting.

I really initially believe that the coreutils are defined as less as possible.

ctrl-alt-delor
  • 27,473
  • 9
  • 58
  • 102
AbstProcDo
  • 2,453
  • 4
  • 23
  • 55
  • 1
    Not sure I understand the question. The second answer [in this thread](https://askubuntu.com/questions/103913/difference-between-dir-and-ls-terminal-commands) seems to explain the difference. – number9 Nov 07 '18 at 02:43
  • 1
    "GNU's Not Unix". GNU utilities are _not_ minimalistic. They are primarily _convenient_. This means that they generally break with the Unix tradition of "doing one thing only, and doing it well". Other examples of this is the `-printf` predicate to GNU `find` and and various other extra features crammed into various other utilities (features that are already handled by another set of utilities). – Kusalananda Nov 07 '18 at 08:05
  • And we already have https://unix.stackexchange.com/questions/50377/ (and its duplicates) asking what the difference between them is. – JdeBP Nov 07 '18 at 13:07

1 Answers1

1

GNU is not completely minimal and dir is a common Microsoft command so it's aliased for convenience. Wiki is missing a full history but one might construct history from open-source archives.. https://en.m.wikipedia.org/wiki/Dir_(command)

user1133275
  • 5,488
  • 1
  • 19
  • 37
  • The Unix minimal philosophy is about each command being minimal, not about minimal number of commands. However I see not whey there are 3 commands that do the same (or near same) thing. – ctrl-alt-delor Nov 07 '18 at 09:07
  • "Aliased" is a really bad choice of words for what `dir` is in terms of the GNU coreutils. A default shell alias proper would have done as nicely as providing a separate command. – 0xC0000022L Nov 07 '18 at 09:13
  • One would be better off constructing a history by reading books, wherein one will find that these two commands come from TOPS-20, not Microsoft, and that actual shell aliases used to be recommended for people used to the TOPS-20 commands. – JdeBP Nov 07 '18 at 09:26