Need help with the terminal or command-line tasks? Contact our support team and we'll assist you.


cPanel includes a browser-based Terminal that gives you command-line access to your hosting account without needing an SSH client. This guide explains how to access it and some of the most useful commands you can run.

Accessing the cPanel Terminal

  1. Log in to cPanel (my.hostdada.co.uk/cpanel).
  2. Scroll to the Advanced section and click Terminal.
  3. Read and accept the warning about responsible use.
  4. The terminal opens in your browser. You are logged in as your cPanel user and start in your home directory (/home/yourusername/).

Note: The cPanel Terminal runs as your account user, not as root. You can work within your home directory and public_html, but you cannot access system-level directories.


Essential Commands for Hosting Tasks

Navigate Your Files

# Show current directory
pwd

# List files (including hidden files)
ls -la

# Change to your website root
cd ~/public_html

# Go up one directory
cd ..

Work With Files

# Create a new file
touch filename.txt

# View a file
cat filename.txt

# Copy a file
cp source.txt destination.txt

# Move or rename a file
mv oldname.txt newname.txt

# Delete a file (no undo — be careful)
rm filename.txt

# Delete a directory and its contents
rm -rf directoryname/

Set File Permissions

# Set a file to 644 (owner read/write, others read-only)
chmod 644 filename.php

# Set a directory to 755 (owner full, others read/execute)
chmod 755 directoryname/

# Fix all WordPress file permissions at once
find ~/public_html -type f -exec chmod 644 {} \;
find ~/public_html -type d -exec chmod 755 {} \;

WordPress CLI (WP-CLI)

WP-CLI is a powerful command-line tool for managing WordPress. Run these from your WordPress directory:

# Check WordPress version
wp core version

# Update WordPress
wp core update

# Update all plugins
wp plugin update --all

# List all users
wp user list

# Reset a user's password
wp user update username --user_pass=NewPassword123

# Regenerate .htaccess (fixes some 404 issues)
wp rewrite flush

# Clear object cache
wp cache flush

MySQL Database Tasks

# Connect to MySQL
mysql -u yourusername -p

# List databases (once connected)
SHOW DATABASES;

# Select a database
USE database_name;

# Exit MySQL
exit

Check Disk Usage

# Total disk usage for your account
du -sh ~/

# Top 10 largest directories
du -sh ~/* | sort -rh | head -10

# Check file system usage (overall)
df -h

SSH Access (External Terminal Clients)

If you prefer using your own terminal application (e.g. PuTTY, macOS Terminal, Windows Terminal), you can connect via SSH:

  1. In cPanel, go to Security > SSH Access to manage SSH keys.
  2. Connect using:
    ssh yourusername@yourdomain.com -p 22
  3. Enter your cPanel password when prompted.

Troubleshooting

  • Terminal not available: The Terminal feature must be enabled in WHM. If you can't see it, contact our support team.
  • Permission denied errors: You are running as your cPanel user — you cannot access files owned by root or other users.
  • Command not found (wp): WP-CLI may not be in your PATH. Try /usr/local/bin/wp instead of wp.

If you need to run a command that requires elevated permissions, open a support ticket and we can carry out the task on your behalf.

Je li Vam ovaj odgovor pomogao? 0 Korisnici koji smatraju članak korisnim (0 Glasovi)