---
title: Bash Command Execution on Individual Sites
url: "https://pressable-staging.mystagingwebsite.com/knowledgebase/bash-command-execution-on-individual-sites/"
published: 2025-03-11
modified: 2025-03-11
author: Varsha Adusumilli
---

With **Bash Command Execution** integrated directly into each site’s My.Pressable.com Dashboard page, executing commands is faster, easier, and more accessible. This feature allows you to securely execute Bash commands for individual sites —whether for troubleshooting, running scripts, or managing files.

The [Bulk Operations](https://pressable-staging.mystagingwebsite.com/knowledgebase/run-bulk-operations-on-your-pressable-sites/) feature is still accessible and recommended when running commands on multiple sites.

## How to Execute Bash Commands

The **Bash Command Execution** feature is available in the **Advanced** section of the Site’s Settings Page under the **Bash Command** tab.

![Navigate to Bash Command on MPCP](https://i0.wp.com/pressable-staging.mystagingwebsite.com/wp-content/uploads/2025/02/bash-command-tab.png?resize=1024%2C562&ssl=1)Clicking the **Bash Command** button takes you to the **Bash Command Execution** section. You can enter the Bash Command that you wish to run in the text box provided and hit the **Run Bash Command** button. This will immediately run the command on the site that you are currently working on.

![Bash Command Execution Section](https://i0.wp.com/pressable-staging.mystagingwebsite.com/wp-content/uploads/2025/02/bash-command-execution-section.png?resize=1024%2C411&ssl=1) 
 Important Note: **Do not send sensitive information** like passwords, API keys, etc. via Bash commands, as these messages are not encrypted and are stored in plain text for logging purposes.

You will see a notification confirming that the command is running.

![Executing Bash Command Notification](https://i0.wp.com/pressable-staging.mystagingwebsite.com/wp-content/uploads/2025/02/executing-bash-command.png?resize=1024%2C458&ssl=1)

## Running Custom Bash Scripts

Creating and running Custom Bash **Scripts** needs a couple of additional steps, unlike the simple commands that can directly be entered as a Bash Command. Once you have your script ready, you need to create a bash file.

#### **Steps to create a .sh Bash script**

1. Login to any of your Pressable sites (`<a href="https://yourdomain.com/yourownscriptname.sh" rel="noreferrer noopener" target="_blank">yourdomain.com</a>`) within the same account you are looking to run the bash script via SSH. We’d recommend doing this on a staging/test site.
2. Create your `.sh` file on the site root (/htdocs):
    `nano yourownscriptname.sh`
3. You can now copy-paste your code into the file and save it. 
    (Press `CTRL + O` to save, then `CTRL + X` to exit.)
4. Change the file permissions to make it executable:
    `chmod -v +x yourownscriptname.sh`
5. Run the script on the test site where you created the file to ensure that it is doing what you expect –
    `bash yourownscriptname.sh` or `./yourownscriptname.sh`
6. Run the script using this command in the Bash Command Execution tool –
    `curl -s <a href="https://yourdomain.com/yourownscriptname.sh" rel="noreferrer noopener" target="_blank">https://yourdomain.com/yourownscriptname.sh</a> | bash`

You can use the same command to run the script on multiple sites via the Bash Command Tool or the Bulk Operations Tool.

## Bash Command Execution History

Once a Bash Command operation has run, it will show up in the WordPress History log located within the site’s settings page under the `WordPress` tab within the `History` section.

![Navigating to bash command history](https://i0.wp.com/pressable-staging.mystagingwebsite.com/wp-content/uploads/2025/02/bash-commands-history-navigation.png?resize=1024%2C600&ssl=1)You will see the logs here titled `Command`. In these history logs, you will also see other WordPress actions like Theme or Plugin changes. The `Log Message` will show steps executed during the process and can come in handy when troubleshooting issues.

![bash command history](https://i0.wp.com/pressable-staging.mystagingwebsite.com/wp-content/uploads/2025/02/bash-command-history-1024x433.png?resize=1024%2C433&ssl=1)

## Command Execution Limits & Security Measures

A **Bash command cannot be empty** because the system requires a valid instruction to execute, ensuring meaningful processing. Enforcing this requirement helps prevent the mishandling of requests and enhances security by avoiding potential misuse. If an empty command is submitted a prompt as shown below will be seen.

![Empty Bash Command error/warning notification](https://i0.wp.com/pressable-staging.mystagingwebsite.com/wp-content/uploads/2025/02/empty-bash-command.png?resize=1024%2C446&ssl=1)

This operation was designed to allow **only one Bash Command execution to run at a time**. This approach ensures the reliability, consistency, and safety of the site during these potentially impactful operations.

If there is an attempt to start a new Bash Command operation while one is already in progress, a prompt will appear to notify you that an operation is currently running.

![](https://i0.wp.com/pressable-staging.mystagingwebsite.com/wp-content/uploads/2025/02/bash-command-already-running-notice.png?resize=1024%2C457&ssl=1)
