For every program/utility on Unix, I would type the name of the program followed by --version to check its version, like so
program --version
If I understand correctly, the double dash -- is used to specify a single option named version instead of -version, which would mean 7 options v,e,r,s,i,o,n. Why is it then that for java and javac I have to use -version with a single dash. Java --version does not even work. Can someone please explain this to me? Thank you in advance.
-char(s)/--word
convention, but in recent years has added lots of-word
items and discouraged, if not actually deprecated or removed, the-char
forms. For examplejava
in 9 up (but not 8, which OP may have) has both-version
and--version
which produce slightly different output, and-fullversion
but not--fullversion
. – dave_thompson_085 Feb 17 '23 at 01:31