-1

I'd like to know the possible versions of ls that exist and how they differ from one another.

I am actually working on man page of ls but I'm not getting the right results even though the options are correct so I'm thinking maybe the version of ls is the issue here.

Jeff Schaller
  • 67,283
  • 35
  • 116
  • 255
kiel28
  • 11
  • 2
    There will be hundreds of implementations (some sharing some ancestry) and hundreds of versions of each. Some implementations are portable ones and their behaviour may vary depending on what system they are built on and the build-time options. That's too broad a question. – Stéphane Chazelas Mar 23 '18 at 12:34
  • use which ls or whereis ls to find your version? use ls --version to see your version. – Archemar Mar 23 '18 at 13:00

2 Answers2

2

Just curious why you are asking. If ls is behaving differently it could be due to an alias. For example, I type:

$ which ls

...and I get:

alias ls='ls --color=auto'
Archemar
  • 31,554
  • That's because you have an alias for your ls in your ~/.bashrc. Remove/comment the alias and source ~/.bashrc and it will work. – 3nrique0 Mar 23 '18 at 14:29
2

The manpage of ls should reflect the version of the binary installed in your system.

If it behaves differently, it's probably because of an alias. Type alias and see if there's an alias that references ls. If there is, you can run the non-aliased version of ls either via

\ls

or by specifying the full path to the command, e.g.

/usr/bin/ls

You will find the full path via the command whereis ls.

dr_
  • 29,602
  • Of course, on systems which have /usr/bin/ls, /usr/ucb/ls, /usr/xpg4/bin/ls, and /usr/xpg6/bin/ls there is no "the" ls program. Although such systems do tend to have one manual page for all of those programs. But that manual page still does not cover /opt/sfw/bin/gls (from a CD of additional utilities provided by the operating system vendor) and /opt/csw/bin/ls and /usr/local/bin/ls (from WWW sites). (-: – JdeBP Mar 23 '18 at 19:01