Introduction
Jenkins can run shell commands directly in its pipelines. This lets you automate tasks like building, testing, or deploying software by running simple scripts inside your pipeline.
When you want to run Linux shell commands in a Jenkins pipeline on a Linux agent.
When you need to execute Windows batch commands in a Jenkins pipeline on a Windows agent.
When you want to automate running scripts without creating separate script files.
When you want to quickly test commands inside your Jenkins pipeline.
When you need to run commands that prepare your build environment or clean up after builds.