Bash Command Execution on Individual Sites

Last modified: March 11, 2025

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 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

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

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

Executing Bash Command Notification

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 (yourdomain.com) 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 https://yourdomain.com/yourownscriptname.sh | 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

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

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

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.