WordPress developers spend a significant portion of their time working on remote Linux servers: deploying code, diagnosing errors, managing files, and monitoring performance. Knowing a core set of Linux command-line tools removes the dependency on cPanel file managers, FTP clients, and hosting control panel dashboards — all of which are slower, less capable, and sometimes simply unavailable on VPS and cloud environments. SSH access is standard on virtually every managed WordPress host and universally available on VPS and dedicated server plans. Once connected, a relatively small set of commands covers the vast majority of daily developer tasks without ever opening a browser-based control panel. Disk space exhaustion is one of the most common emergencies on WordPress sites: an uploads directory that grew unchecked, a debug log file that was never rotated, or a compressed backup that filled the partition. The df and du utilities let you locate the problem and quantify its size in seconds. File permission errors account for another large category of WordPress support issues: the core application needs specific directory and file permissions to write uploads, generate cache files, and apply automatic updates. The find command combined with chmod can normalize permissions recursively across an entire installation in a single line. Apache and PHP error logs are the fastest diagnostic tool when a plugin is behaving unexpectedly or a fatal error is appearing intermittently — tail -f streams new log entries to your terminal in real time so you can watch errors as you reproduce the problem in the browser. Process monitoring with ps shows you whether a runaway PHP worker or a stuck MySQL query is consuming all available CPU. Restarting the web server after a configuration change is a one-liner that takes less time than navigating to the equivalent button in a hosting panel. The commands below focus specifically on the operations WordPress developers perform most often on typical Ubuntu or CentOS production servers.
Problem: Performing common server-side WordPress maintenance tasks without knowing which Linux commands to use.
Solution: Essential Linux commands for WordPress environments:
# Show disk space usage by partition
df -h
# Show total size of the uploads directory
du -sh /var/www/html/wp-content/uploads/
# Find files larger than 10MB (useful for locating oversized backups or logs)
find /var/www/html -type f -size +10M -exec ls -lh {} \;
# Fix standard WordPress file and directory permissions
find /var/www/html -type f -exec chmod 644 {} \;
find /var/www/html -type d -exec chmod 755 {} \;
chmod 600 /var/www/html/wp-config.php
# Stream Apache error log in real time
tail -f /var/log/apache2/error.log
# Stream Nginx error log in real time
tail -f /var/log/nginx/error.log
# Restart Apache or Nginx after config changes
sudo service apache2 restart
sudo service nginx restart
# List active PHP-FPM processes
ps aux | grep php-fpm
NOTE: Replace /var/www/html with your actual document root — common alternatives include /home/user/public_html on cPanel hosting and /var/www/yourdomain.com on many VPS setups. The find + chmod commands are safe to run on a live site but briefly lock individual files during traversal on large installations. If your host runs Apache 2.4 with mod_mpm_event, PHP processes appear under php-fpm rather than apache2 — check both when diagnosing high CPU usage.