ssh version output in stderr
Briefly

"Generally Linux commands print their version on stdout, for example git --version or python --version. But not ssh. ssh -V prints output to stderr. To test it you can do the following: git version on stdout > git --version 2> error 1> output > cat output git version 2.51.0 ssh version on stderr > ssh -V 2>> error 1>> output > cat error OpenSSH_9.9p1, OpenSSL 3.2.4 11 Feb 2025 Hope this will be helpful."
"git version on stdout > git --version 2> error 1> output > cat output git version 2.51.0 ssh version on stderr > ssh -V 2>> error 1>> output > cat error OpenSSH_9.9p1, OpenSSL 3.2.4 11 Feb 2025"
Most Linux commands output version information to stdout, but ssh -V writes its version string to stderr. The git example shows git --version producing "git version 2.51.0" on stdout. The ssh example shows ssh -V appending "OpenSSH_9.9p1, OpenSSL 3.2.4 11 Feb 2025" to stderr. To capture or redirect ssh version output, redirect stderr using 2> or 2>>. Use 1> or 1>> to capture stdout. Knowing which stream a command uses matters for scripting, logging, and piping.
Read at anweshadas.in
Unable to calculate read time
[
|
]