Essential Linux Commands Every Website Owner Should Know
- Control Panels and Tools
- Jason Carter
If you've ever needed to troubleshoot a slow website, check error logs or manage server files, you've likely encountered Linux commands. These are text-based instructions you type into a terminal to control your server, manage files, monitor performance and resolve issues without clicking through graphical interfaces. Most UK website owners on shared hosting never see the command line because control panels handle everything visually. Understanding basic Linux commands becomes essential when you move to VPS or dedicated hosting, manage your own server or need to troubleshoot WordPress issues via SSH.
We've organised the most practical commands by task: navigation, file handling, monitoring and security, with real examples relevant to hosting scenarios. Think of this as your reference for when you need to check disk space, restart a web server or find error logs quickly.
Why Linux Commands Matter for Your Website Hosting
Most UK shared hosting customers never touch the command line because control panels like cPanel and Plesk handle everything visually. Linux commands become valuable when you upgrade to VPS or dedicated hosting, need to troubleshoot issues your control panel can’t fix, want to automate tasks via scripts or need faster access to server information than clicking through menus.
Major UK hosting providers run Linux servers using distributions like Ubuntu, CentOS and Debian. These commands work consistently across platforms. Even on managed WordPress hosting, support teams may ask you to run commands to gather diagnostic information. Your WordPress site is down and the control panel shows nothing? Knowing how to check error logs via SSH can save hours of downtime.
Learning 10 to 15 core commands gives you confidence and control, reducing your reliance on support tickets for simple tasks. Most UK VPS and dedicated servers run Linux distributions where commands work identically. Shared hosting typically doesn’t provide SSH access, whilst VPS and dedicated hosting do. Control panels abstract away command-line work, but direct terminal access is faster for many tasks.
Getting Started with the Linux Terminal
Before you learn specific commands, you need to access your server’s command line. We’ll cover connecting remotely, understanding what you see in the terminal and following safety practices to avoid costly mistakes.
Connecting via SSH
SSH (Secure Shell) is how you access your server’s command line remotely. On Windows, use PuTTY or Windows Terminal. On Mac or Linux, use the built-in Terminal app. The basic connection syntax is ssh username@your-server-ip or ssh username@yourdomain.com, then enter your password or use SSH keys for better security.
Your hosting provider supplies the username, IP address and initial password. Shared hosting often doesn’t provide SSH access. VPS and dedicated hosting do. Hostinger VPS customers find SSH credentials in their hPanel dashboard under ‘Server Details’. If you need to transfer files without full command-line access, SFTP provides a secure alternative for shared hosting customers.
Understanding the Command Prompt
The prompt typically shows username@hostname:~$ where the tilde (~) means your home directory and the dollar sign ($) indicates a regular user. A hash symbol (#) means root or superuser access. You type commands after the prompt and press Enter to execute.
Commands are case-sensitive. Typing LS won’t work; you must use ls. The basic structure follows this pattern: command, options and arguments. For example, ls -la /var/www lists files in long format with hidden items in the /var/www directory. You can recall previous commands with the Up arrow key and use Tab to auto-complete file and directory names, which saves time and reduces typos.
Safety and Best Practices
Some commands are destructive. The command rm -rf can delete entire directories with no undo. Always double-check paths before executing. Use sudo (superuser do) only when necessary, as it grants full system permissions. Mistakes have bigger consequences with elevated privileges.
Test commands on non-critical files first. Keep backups before major changes. Use man command or command --help to understand what a command does before running it. Copying commands from the internet without understanding them is risky. Before running rm -r, use ls -la to verify you’re targeting the right directory. One typo like typing rm -rf / instead of rm -rf ./folder can destroy your entire server.
Navigation and File System Commands for Website Management
When you manage your website files, you need to navigate directories to find site files, logs and configuration files. Understanding where your WordPress installation lives or locating error logs quickly makes troubleshooting far more efficient.
Moving Between Directories
The pwd command (print working directory) shows where you are. The cd command (change directory) moves you around. Use cd .. to go up one level. Shortcuts include cd ~ or just cd to return to your home directory and cd - to go back to the previous directory.
| Command | Purpose | Example |
|---|---|---|
| pwd | Show current directory | pwd |
| cd | Change directory | cd /var/www/html |
| cd .. | Move up one level | cd .. |
| cd ~ | Return to home | cd ~ |
Paths starting with a forward slash (/) are absolute paths from root. Others are relative to your current location. To reach your WordPress installation, you might use cd /var/www/yourdomain.com/public_html.
Listing Files and Directories
The ls command lists directory contents. Useful options include ls -l for detailed lists showing permissions, owner, size and date. Use ls -a to show hidden files including .htaccess, which is crucial for WordPress. The ls -lh option displays human-readable file sizes in MB or GB instead of bytes. For recursive listing of subdirectories, use ls -R.
You can combine options: ls -lah shows detailed, hidden and human-readable information. Hidden files start with a dot and are often configuration files. To list a specific directory without changing to it, use ls -la /var/log. Use ls -lah to quickly see all files including .htaccess and their sizes when troubleshooting WordPress.
Finding Files Quickly
The find command offers powerful searching, whilst locate provides faster but less flexible searches. The find syntax follows this pattern: find /path -name "filename" to search by name. Use find /var/www -name "*.log" to find all log files or find . -type f -mtime -7 to find files modified in the last seven days.
The find command searches in real-time, so it’s slower but always current. The locate filename command searches a pre-built database that updates daily via updatedb, making it faster but potentially missing very recent files. To locate WordPress error logs, use find /var/www/yourdomain.com -name "error_log". When you need to identify large files consuming disk space, find helps you track them down quickly.
Managing Files and Directories on Your Server
Creating backups, organising files, uploading content and cleaning up old data are essential tasks for any website owner on VPS or dedicated hosting. These commands give you direct control over your server’s filesystem.
Creating Directories and Files
The mkdir directoryname command creates a single directory. Use mkdir -p path/to/nested/directory to create nested directories in one command, which is useful for organising site backups or logs. The touch filename command creates an empty file or updates the timestamp of an existing file. This is often used to create placeholder files or test write permissions.
To organise monthly backups, use mkdir ~/backups/wordpress-2026-01. If your .htaccess file is missing, create it with touch /var/www/html/.htaccess. These commands help you maintain an organised server structure.
Copying and Moving Files
The cp source destination command copies files. Use cp -r sourcedir destdir to copy directories recursively, which is essential for backing up WordPress themes and plugins. The mv source destination command moves or renames files and directories. For example, mv old-theme new-theme renames, whilst mv file.txt ~/backups/ moves the file.
To backup a theme, use cp -r /var/www/html/wp-content/themes/mytheme ~/backups/. To archive old logs, use mv error_log error_log.old. The mv command is instant because it just updates filesystem pointers, whilst cp takes time proportional to file size. Always use cp -r not cp when backing up WordPress directories, or you’ll only copy the top-level folder. For more advanced scenarios, our guide on copying files via SSH covers remote transfers between servers.
Deleting Files and Directories Safely
The rm filename command deletes files. Use rm -r directoryname to delete directories and their contents recursively. The rm -f flag forces deletion without confirmation, which is dangerous. There’s no recycle bin on the Linux command line. Deletion is permanent.
The rmdir directoryname command is a safer alternative that only deletes empty directories. It fails if contents exist, preventing accidents. Use ls first to verify what you’re deleting. Avoid rm -rf / patterns. Consider moving files to a “trash” directory instead of immediate deletion. To remove an old backup, use rm /var/www/html/old-backup.tar.gz. To clean up an empty directory, use rmdir /var/www/html/empty-test-folder.
Viewing and Searching File Contents
Reading error logs, checking configuration files and searching for specific issues are critical troubleshooting skills. We often see website owners struggle with WordPress errors that could be resolved in minutes by checking the right log file.
Reading Files in the Terminal
The cat filename command displays entire file contents, useful for short files like .htaccess. The less filename command views large files page by page. Use Space to scroll down and press q to quit. This is essential for reading long error logs. The head filename command shows the first 10 lines, or use head -n 20 for the first 20 lines. The tail filename command shows the last 10 lines, critical for checking latest log entries.
The tail -f filename command follows a file in real-time as new lines are added, perfect for monitoring live error logs whilst testing. To watch Apache errors live, use tail -f /var/log/apache2/error.log. To check WordPress database settings, use head -n 50 /var/www/html/wp-config.php. Use tail -f whilst reproducing a WordPress error to see exactly what’s logged in real-time.
Searching Within Files
The grep "search-term" filename command finds lines containing specific text. Use grep -i for case-insensitive search. The grep -r "search-term" /path command searches recursively through all files in a directory, powerful for finding where a setting is defined across multiple config files. Use grep -n to show line numbers, helpful when editing files.
To find PHP errors, use grep "Fatal error" /var/log/apache2/error.log. To locate where database credentials are stored, use grep -r "database_password" /var/www/html/. To count 404 errors, use grep -i "404" /var/log/nginx/access.log | wc -l, which pipes the output to wc -l to count lines. The grep command is one of the most powerful troubleshooting tools you have. Pipe grep to less for easier reading of long results: grep 'error' logfile | less.
Monitoring Server Resources and Performance
On VPS or dedicated hosting, you need to know if your server is running out of memory, disk space or CPU before your site goes down. Regular monitoring prevents emergency situations where your WordPress site suddenly becomes unavailable.
Checking Disk Space Usage
The df -h command shows disk space for all mounted filesystems in human-readable format. It displays total, used, available and percentage for each partition, essential for spotting when you’re running out of space. The du -sh /path command shows the total size of a specific directory. For example, du -sh /var/www/html checks your website size. Use du -h --max-depth=1 /path to see the size of subdirectories one level deep, useful for identifying which WordPress folder is consuming most space.
Use df -h to check if your root partition is full, a common cause of site failures. To see how much space media files use, run du -sh /var/www/html/wp-content/uploads. Hosting providers typically alert when disk is 80% or more full, but checking manually helps prevent emergencies. When checking RAM usage alongside disk space, you get a complete picture of your server’s resource health. Your WordPress site shows database connection errors? Running df -h might reveal that the root partition (/) is 100% full, likely due to massive error logs.
Monitoring Running Processes
The top command is a real-time process monitor showing CPU and memory usage. Press q to quit. Key columns include PID (process ID), USER, CPU%, MEM% and COMMAND. The htop command is a more user-friendly alternative with colour-coding and easier navigation, though it may need installing via apt install htop.
The ps aux command lists all running processes with details. Use ps aux | grep apache2 to find specific processes, checking if your web server is running. Use top to identify which process is consuming 100% CPU, common when a WordPress plugin misbehaves. To verify your database is running, use ps aux | grep mysql. High memory usage leads to swapping and slow site performance. If top shows php-fpm using 90% memory, your WordPress site is likely overloading your VPS. Time to optimise or upgrade.
System Information and Uptime
The uptime command shows how long your server has been running and current load average. The three numbers show 1, 5 and 15-minute load averages. As a rule of thumb, load should be below the number of CPU cores. The uname -a command shows kernel version and system architecture. The free -h command displays RAM usage showing total, used, free and available. The “available” column indicates memory for new processes.
Use uptime after reboot to verify your server restarted correctly. Use free -h to check if you’re running out of memory. High usage with low “available” means you need more RAM or to optimise. Load average above your CPU core count indicates server strain. For example, a load of 4.0 on a 2-core VPS means processes are waiting. If uptime shows a load average of 8.0 on your 2-core VPS, your WordPress site is overwhelming the server, likely due to a traffic spike or inefficient plugins.
Managing Services and Processes for Web Hosting
Restarting web servers, checking service status and controlling background processes are essential skills when you manage your own VPS or dedicated server. These commands give you direct control over the services that keep your website running.
Controlling Services with systemctl
Modern Linux distributions like Ubuntu 16.04 and later, CentOS 7 and later and Debian 8 and later use systemd for service management via the systemctl command. Key operations include sudo systemctl status servicename to check if a service is running, sudo systemctl start servicename to start a stopped service, sudo systemctl stop servicename to stop a running service and sudo systemctl restart servicename to restart, which is essential after config changes.
The sudo systemctl reload servicename command reloads configuration without a full restart, which is less disruptive. Use sudo systemctl restart apache2 after editing .htaccess. Use sudo systemctl status mysql to verify your database is running when WordPress shows connection errors. The sudo prefix is required because service control needs root privileges. Common services include apache2, nginx, mysql, mariadb and php-fpm. Hostinger VPS runs Ubuntu 22.04 with systemd, so use systemctl for all service management.
| Command | Purpose | Example |
|---|---|---|
| sudo systemctl status | Check service status | sudo systemctl status nginx |
| sudo systemctl start | Start service | sudo systemctl start mysql |
| sudo systemctl restart | Restart service | sudo systemctl restart apache2 |
Managing Individual Processes
The kill PID command terminates a process by its process ID, which you find via top or ps. The kill -9 PID command force-kills an unresponsive process. Use this as a last resort. The pkill processname command kills by name, such as pkill php to stop all PHP processes. This is dangerous, so use carefully.
The jobs command lists background jobs in your current terminal session. Use bg to resume a stopped job in the background and fg to bring a background job to the foreground. Use top to find the PID of a runaway PHP process consuming 100% CPU, then kill PID to stop it. To kill stuck WordPress cron jobs, use pkill -f "wp-cron". Killing critical processes like mysql or sshd can break your server or lock you out. WordPress cron is stuck running every second, overloading CPU. Use ps aux | grep wp-cron to find the PID, then kill PID to stop it.
User Permissions and Security Commands
File permissions directly affect your website’s security and functionality. In our experience, incorrect permissions are among the most common causes of WordPress hacks and upload failures that website owners encounter.
Understanding File Permissions
The permission format shown by ls -l looks like -rw-r--r--. The first character is the type: a dash (-) for file or d for directory. The next nine characters form three groups of three showing read (r), write (w) and execute (x) permissions for owner, group and others.
Numeric notation uses 4 for read, 2 for write and 1 for execute, summed for each group. For example, 644 means owner read plus write (6), group read (4) and others read (4). The value 755 means owner all permissions (7), group and others read plus execute (5). Common WordPress permissions include 644 for files (readable by all, writable only by owner), 755 for directories (executable needed to enter directory) and 600 for sensitive files like wp-config.php (only owner can read and write).
| Code | Meaning | Use Case |
|---|---|---|
| 644 | Owner read/write, others read | Standard files |
| 755 | Owner all, others read/execute | Directories |
| 600 | Owner read/write only | wp-config.php |
| 777 | All permissions for everyone | Security risk, avoid |
To read permissions, look at -rw-r--r-- 1 www-data www-data 2048 Jan 15 10:30 index.php. This means owner www-data can read and write, whilst everyone else can only read. Wrong permissions cause upload failures or security vulnerabilities.
Changing File Permissions
The chmod permissions filename command changes permissions using either numeric format like chmod 644 index.php or symbolic notation like chmod u+x script.sh to add execute for owner. Use chmod -R to apply recursively to all files in a directory, essential for fixing WordPress permission issues.
To set correct file permissions after upload, use chmod 644 /var/www/html/wp-content/uploads/*. To allow the web server to create files in the uploads directory, use chmod 755 /var/www/html/wp-content/uploads. To secure your WordPress config file, use chmod 600 /var/www/html/wp-config.php. Never use chmod 777 on production sites. It’s a security vulnerability that makes files world-writable, allowing hackers to modify them. If a plugin demands it, find a better plugin.
Managing File Ownership
The chown owner:group filename command changes file owner and group. This requires sudo. Use chown -R for recursive changes. The web server, typically www-data on Ubuntu or apache on CentOS, needs to own WordPress files to write uploads, create cache and update plugins.
To give the web server ownership of your entire WordPress installation, use sudo chown -R www-data:www-data /var/www/html/. This is a common fix after manual file uploads via SFTP. To let you edit theme files whilst allowing the web server to read them, use sudo chown yourusername:www-data /var/www/html/wp-content/themes/. Wrong ownership causes “permission denied” errors when WordPress tries to upload media or update. After uploading WordPress files via SFTP, your site shows “failed to write file to disk”. Running sudo chown -R www-data:www-data /var/www/html/ fixes ownership so the web server can write uploads.
Networking Commands for Troubleshooting Connectivity
When your site won’t load or emails aren’t sending, networking commands help you diagnose whether the problem is DNS, server connectivity or configuration. These tools quickly narrow down where issues originate.
Testing Server Connectivity
The ping hostname command tests if a server is reachable and measures response time. For example, use ping google.com or ping your-server-ip. The output shows time in milliseconds. Under 50ms is excellent, whilst over 200ms is slow. It also shows packet loss percentage. Zero percent is perfect, whilst any loss indicates network problems.
The ping command runs continuously until you press Ctrl+C. Use ping -c 4 hostname to send only four packets. To verify DNS is resolving and your server is responding, use ping yourdomain.com. To test if your server has internet connectivity, use ping 8.8.8.8, which is Google’s DNS. Some servers block ping (ICMP) for security, so no response doesn’t always mean the server is down. Your WordPress site won’t load. Running ping yourdomain.com shows “request timeout”, indicating either DNS failure or the server is down.
Checking DNS and Network Configuration
The nslookup domain command queries DNS records, showing which IP address a domain resolves to. The dig domain command is a more detailed alternative showing the full DNS query process, useful for troubleshooting DNS propagation after changes. The ip addr or ifconfig command shows your server’s network interfaces and IP addresses. This verifies your server’s IP matches what DNS points to.
To verify DNS points to the correct server IP after migration, use nslookup yourdomain.com. To check DNS propagation, use dig yourdomain.com and compare results from different locations. To confirm your server’s actual IP address, use ip addr show. DNS changes take time to propagate, typically minutes to hours and occasionally up to 48 hours. A mismatch between DNS and server IP causes your site to load the wrong server or not at all.
Downloading Files and Testing URLs
The wget URL command downloads files from the web. For example, wget https://wordpress.org/latest.tar.gz downloads WordPress directly to your server. The curl URL command fetches URL content, useful for testing if your web server responds correctly or checking API endpoints. The curl -I URL command shows only HTTP headers. Check status codes: 200 means OK, 301 is a redirect, 404 is not found and 500 is a server error. This is essential for troubleshooting.
To download a backup to your server, use wget https://example.com/backup.zip. To verify your web server returns 200 OK, use curl -I https://yourdomain.com. To test the WordPress REST API, use curl https://yourdomain.com/wp-json/. The wget command saves to a file, whilst curl displays output. Use curl -o filename URL to save. For more complex scenarios involving extracting compressed files you’ve downloaded, refer to our dedicated guide.
Package Management for Installing Software
When you run VPS or dedicated hosting, you’ll need to install and update server software like web servers, PHP versions, databases and security tools. Package managers automate this process and handle dependencies.
Using apt on Ubuntu and Debian
Ubuntu and Debian use apt (Advanced Package Tool) for software management. Key commands include sudo apt update to refresh the package list (always run first), sudo apt upgrade to install available updates for all installed packages, sudo apt install packagename to install new software and sudo apt remove packagename to uninstall. Use sudo apt autoremove to clean up unused dependencies.
To update all packages, use sudo apt update && sudo apt upgrade -y. This is a common maintenance task. To install PHP and MySQL extension for WordPress, use sudo apt install php8.1-fpm php8.1-mysql. The apt command requires sudo and internet connectivity. Always run update before upgrade or install. Updates can occasionally break things, so test on staging first for production servers. Run sudo apt update && sudo apt upgrade monthly to keep your server secure with latest patches.
Using yum and dnf on CentOS and RHEL
CentOS and RHEL use yum (older versions) or dnf (CentOS 8 and later, RHEL 8 and later) for package management. Commands are similar to apt. Use sudo yum update or sudo dnf update to update all packages. Use sudo yum install packagename or sudo dnf install packagename to install software. Use sudo yum remove packagename to uninstall.
To install Apache on CentOS 8 and later, use sudo dnf install httpd. To install MariaDB on older CentOS, use sudo yum install mariadb-server. The dnf command is the modern replacement for yum with better performance and dependency resolution. Package names sometimes differ from Ubuntu. For example, use httpd instead of apache2 and mariadb instead of mysql. If you’re on CentOS 7 or older, use yum. CentOS 8 and later and Rocky Linux use dnf.
Compressing and Archiving Files for Backups
The tar command is the standard Linux archiving tool, often combined with compression. Key operations include tar -czf archive.tar.gz /path/to/directory to create a compressed archive (c for create, z for gzip compression, f for filename), tar -xzf archive.tar.gz to extract (x for extract) and tar -tzf archive.tar.gz to list contents without extracting (t for list).
To backup your entire WordPress site, use tar -czf ~/backups/wordpress-backup-2026-01-15.tar.gz /var/www/html/. To restore a backup to a specific directory, use tar -xzf wordpress-backup.tar.gz -C /var/www/html/. The zip and unzip commands are alternatives familiar to Windows users: zip -r backup.zip /var/www/html/ and unzip backup.zip. The .tar.gz format is standard on Linux, whilst .zip is more cross-platform.
| Operation | Command | Example |
|---|---|---|
| Create archive | tar -czf file.tar.gz /path | tar -czf backup.tar.gz /var/www |
| Extract archive | tar -xzf file.tar.gz | tar -xzf backup.tar.gz |
| List contents | tar -tzf file.tar.gz | tar -tzf backup.tar.gz |
Always test that you can extract backups before relying on them. Large sites produce large archives. Check disk space first with df -h. Add dates to backup filenames like backup-2026-01-15.tar.gz to track versions easily.
Getting Help and Learning More Commands
The man command command views manual pages, which are comprehensive documentation for any command. For example, man ls shows all options and examples. To navigate in man, use Space to scroll down, q to quit and /searchterm to search within the page. The command --help flag is a quicker alternative showing brief usage summary, such as ls --help.
The history command shows a list of previously run commands, useful for recalling complex commands you used before. Use history | grep keyword to search your command history. The compgen -c command lists all available commands, though it’s overwhelming but comprehensive.
Start with the essential commands covered here, then expand as your needs arise. Knowing how to look up commands with man and --help is more valuable than memorisation. Keep a personal cheat sheet of commands you use frequently. You’ll build muscle memory faster than trying to memorise everything at once.
Building Confidence with Linux Commands for Your Hosting
Mastering 10 to 15 core commands gives you significant control over VPS and dedicated hosting environments. You’ve covered the essentials: navigating directories and managing files, monitoring server resources to prevent downtime, controlling services like web servers and databases, securing files with proper permissions, troubleshooting connectivity issues and creating backups.
These skills become particularly valuable when you outgrow shared hosting and move to VPS, where control panels don’t cover everything and direct terminal access is faster for many tasks. Knowing how to use man and --help to look up documentation matters more than rote learning. Start with simple, safe commands like ls, pwd and df -h to build confidence before tackling more complex operations.
Most UK VPS providers like Hostinger, DigitalOcean, Linode and Fasthosts offer Ubuntu or CentOS servers where these commands work identically, so your skills transfer across providers. For website owners still on shared hosting, understanding these commands helps you evaluate whether you’re ready for VPS. If you’re comfortable with SSH and basic commands, you probably are. If it feels overwhelming, managed WordPress hosting might suit you better.
If you’re uncertain whether VPS hosting with command-line management is right for your website, our free advice service can guide you to the right solution. We’ll help you choose a UK hosting provider that matches your technical comfort level and website requirements.
Need help choosing the right web hosting provider?
- 100% free and with no obligation
- Personalised recommendation
- Response within 24 hours
Frequently Asked Questions
Do I need to know Linux commands if I use cPanel or Plesk on my hosting?
Most tasks on cPanel or Plesk don’t require command-line knowledge because these control panels handle file management, database administration and email configuration through graphical interfaces. Linux commands become useful when you need to troubleshoot issues the control panel can’t fix, such as checking detailed error logs, monitoring real-time resource usage or fixing file permissions that cause upload failures. Even on managed hosting with control panels, knowing basic commands like ls, tail -f and df -h helps you diagnose problems faster than clicking through menus. Support teams may also ask you to run commands to gather diagnostic information when resolving complex issues.
What does ls -la actually show me and when would I use it?
The ls -la command shows a detailed list of all files in a directory, including hidden files that start with a dot. The output displays file permissions, owner, group, size, modification date and filename. The -l flag provides the long format with details, whilst -a includes hidden files like .htaccess and .env that are crucial for WordPress configuration. Use this command when troubleshooting permission issues, checking if configuration files exist, verifying file sizes to identify bloat or confirming upload timestamps. It’s particularly useful before making changes to ensure you’re targeting the right files.
How do I safely delete a directory without risking my entire website?
Always use ls -la first to verify the directory’s contents and confirm you’re targeting the correct path. For empty directories, use rmdir directoryname, which fails safely if contents exist. For directories with files, use rm -r directoryname, but double-check the path because there’s no undo. Never use rm -rf / or similar patterns that could delete system files. Consider moving directories to a backup location first with mv directoryname ~/backup/ instead of immediate deletion. Test the command with ls substituted for rm to preview what would be affected. One typo in a recursive delete can wipe your entire site, so caution is essential.
What's the quickest way to check if my server is running out of disk space?
Run df -h to see disk usage for all partitions in human-readable format. Look at the “Use%” column for your root partition (usually mounted at /). If usage exceeds 80%, you’re approaching capacity. If it reaches 100%, your site will fail because the database can’t write and logs can’t update. To identify which directories consume most space, use du -h --max-depth=1 /var/www/html to break down your website’s folders. Common culprits include wp-content/uploads for media files and error logs in /var/log. Checking disk space weekly prevents emergency situations where your site goes down due to full storage.
How can I restart my web server after changing configuration files?
Use sudo systemctl restart servicename where servicename is apache2 for Apache or nginx for Nginx. For example, sudo systemctl restart apache2 restarts Apache after editing .htaccess or virtual host configs. To restart Nginx, use sudo systemctl restart nginx. If you only changed configuration without adding new modules, use sudo systemctl reload servicename instead, which applies changes without fully stopping the service and causes less disruption. Always check the service status afterwards with sudo systemctl status servicename to confirm it restarted successfully. If the restart fails, the status command shows error messages indicating what’s wrong with your configuration.
Are Linux commands the same on Ubuntu, CentOS and other distributions?
Core commands like ls, cd, cp, mv, rm, grep, find and chmod work identically across all Linux distributions because they’re part of the standard GNU coreutils. Package management differs: Ubuntu and Debian use apt, whilst CentOS and RHEL use yum or dnf. Service names sometimes vary, such as apache2 on Ubuntu versus httpd on CentOS for Apache web server. Modern distributions like Ubuntu 16.04 and later and CentOS 7 and later use systemd with systemctl for service management, making those commands consistent. File locations may differ slightly, but core functionality remains the same. Learning commands on one distribution transfers easily to others with minor adjustments for package managers and service names.
written by:
Jason Carter
My name is Jason Carter and I focus on the technical side of Webhosting Benefit. With over 10 years of experience in the IT industry, I bring extensive knowledge and expertise in web hosting. I test different hosting providers, write detailed reviews and comparisons, and continuously work to improve the website so visitors get the best possible experience.






