[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Is `ls` exactly the same as `dir`?
From: |
Mike Hodson |
Subject: |
Re: Is `ls` exactly the same as `dir`? |
Date: |
Tue, 12 May 2015 21:47:56 -0600 |
On Tue, May 12, 2015 at 9:10 PM, Peng Yu <address@hidden> wrote:
> Hi, It seems that `ls` and `dir` are exactly the same after I read the
> man pages. Is it the case?
Hi Peng,
This most certainly appears to be. The binaries on my system are 99%
the same, save for a string that appears to relate to a debug symbol
name and is specific as to the binarys name; but I am not 100%
certain.
See for yourself:
$ vimdiff <(xxd /path/to/dir) <(xxd /path/to/ls)
(BASH and iirc ZSH do this redirect-cmd-pipeline-stdout-as-file,
perhaps others):
This produces http://picpaste.com/dir-vs-ls-vimdiff.png on my system.
They're exactly the same otherwise.
I've not read the source to know where/how this is built, but I am
presuming they come from the same sourcefile with a conditional to
build the proper name of the binary/symbols.
Hope this helps,
Mike