A error happened when using command-line options, such as "--version"

How to use Julia command-line options, for example, I wanted to check the version of Julia using --version, however, it was not worked.

Hi,
Can you mention what you mean by not worked? What did you type in the command line, and what was the output?

$ julia --version
julia version 1.9.0-DEV

should work (according to --help), and actually --versio etc. down to -v… unlike for --help (unless with one hyphen).

You can do (if ever needed):

$ julia -e "println(string(VERSION))"
1.9.0-DEV.432

for a slightly more specific version. Or:

julia> versioninfo()  # or for even more verbose info: versioninfo(verbose=true)

Julia Version 1.9.0-DEV.432
Commit 65b9be4086 (2022-04-25 02:50 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: 16 × Intel(R) Xeon(R) CPU D-1541 @ 2.10GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-13.0.1 (ORCJIT, broadwell)
  Threads: 1 on 16 virtual cores

--version while a common option in Unix/Linux (Windows?) is I think not standardized, except by GNU. I started answering this question assuming it missing…