Command Glossary
quick reference for all CLI commands used in ScriptWP’s bash scripts, with descriptions and best-practice notes.
wp
The WP-CLI command-line interface for WordPress.
Used throughout our scripts to interact directly with your WordPress installation — no dashboard required.
wp db export <file.sql>
Exports your WordPress database to a .sql file.
Used for backups or before running search-replace operations.
👉 Use –quiet to suppress non-critical output.
wp search-replace <old> <new> [options]
Performs a search and replace across the WordPress database.
Handles serialized data safely.
Common options:
- –all-tables: Includes all tables in DB, not just WP core.
- –precise: Uses PHP for better accuracy (especially with serialized content).
- –skip-columns=guid: Skips the guid field (recommended).
- –dry-run: Runs the command without making any changes (safe preview).
wp core update
Checks for and applies any available WordPress core updates.
wp plugin update –all
Updates all installed plugins to their latest versions.
wp theme update –all
Updates all installed themes.
cd
Changes the current working directory.
Used to navigate to the directory where WordPress is installed.
mkdir -p <directory>
Creates a directory and any necessary parent folders.
The -p flag ensures it won’t throw an error if the folder already exists.
tar -czf <archive.tar.gz> <file(s)>
Creates a compressed .tar.gz archive.
Used to bundle files and SQL dumps into a single backup package.
rm <file>
Deletes a file.
Used to clean up temporary database dumps after compression.
chmod +x <file>
Makes a file executable.
Required to run bash scripts via ./script.sh.
crontab -e
Opens your cron table for editing.
Used to schedule scripts to run automatically.
echo
Prints text to the terminal.
Used for feedback like “✅ Backup complete”.
read -p
Prompts the user for input (e.g. confirmation before proceeding).
Common in dry-run → live flow patterns.