Goto Jenkins dashboard, click on New Item

Enter the Pipeline name hello-world-pipeline, select Pipeline, and then click OK

Select the Pipeline section, under Definition choose Pipeline script, and choose Hello World, sample pipeline script is added, and click on Save

In this, we have the Hello stage, which will execute an echo command to print Hello World to the Console Output

Reference: Jenkinsfile Syntax

Click on Build Now

Goto Console OutputHello World is printed on the logs using the echo command. In this way, you can execute any shell commands from the pipeline script.

This way of writing the pipeline script in Jenkins UI is used mostly for testing purposes only. Since the script changes are not trackable.

The better way is to write the pipeline script in Jenkinsfile and store it in a GitHub repository.