Reputation: 71
Find Jenkins version in CLI Command.
I can tell there are 3 ways to do it.
Open config file from the installation directory
cd /var/lib/Jenkins/
Open config.xml
file, to see the version.
Available in bottom of Jenkins’s UI.
grep "version>" /var/lib/jenkins/config.xml
This is the way!
java -jar /usr/share/jenkins/jenkins.war --version
Upvotes: 6
Views: 34163
Reputation: 25
To check the version, use the below command
brew info jenkins-lts
To reach the installed location, If you are installed with brew, you can try this commands.
Upvotes: 1
Reputation: 191
Locate jenkins.war
[1] and run it with java -jar
adding --version
switch, thus:
$ java -jar /path/to/jenkins/jenkins.war --version
where:
path/to/jenkins
is your location of jenkins.war
, which can be as follows (depending on your linux distro):
/usr/lib/jenkins
/usr/share/jenkins
[1] bonus - how to locate Jenkins JAR:
$ cd / && find | grep "jenkins/jenkins.war"
Upvotes: 6
Reputation: 143
Yes, to get the current version of jenkins you can execute
jenkins --version
The jenkins
executable in /usr/bin
is a shell script that determines where the jenkins war is located, and then runs commands against it.
$ jenkins --help
Running from: /usr/share/java/jenkins.war
webroot: $user.home/.jenkins
Jenkins Automation Server Engine 2.332.2
Usage: java -jar jenkins.war [--option=value] [--option=value]
...
a bunch of options to pass to the war file
Upvotes: 1