how to change the port number for jenkins installation on localhost code example
Example: how to change the port number in command prompt for jenkins
//To change the port in command line we use --httpPort command line option
java -jar jenkins.war --httpPort=8081