Category: Server Maintenances

  • How to Extract or Decompress wp-content.tar.gz Using the Linux Command Line

    How to Extract or Decompress wp-content.tar.gz Using the Linux Command Line

    ✏️ Excerpt: Learn how to extract .tar.gz or .zip backup files like wp-content.tar.gz using simple Linux terminal commands. This tutorial is perfect for WordPress developers, sysadmins, or anyone restoring website backups. πŸ“„ Post Content (HTML-Formatted for WordPress Editor): html Copy Edit

    πŸ“¦ How to Extract wp-content.tar.gz on Linux

    If you’re restoring a WordPress backup or moving files between servers, you may come across archive files like wp-content.tar.gz or wp-content.zip. Here’s how to safely extract them using the command line.

    1. For .tar.gz Files

    Run the following command to extract a .tar.gz archive in the current directory:

    tar -xzvf wp-content.tar.gz

    Explanation of flags:

    • x β€” extract
    • z β€” uncompress gzip
    • v β€” verbose (show progress)
    • f β€” specify filename

    To extract into a specific directory:

    tar -xzvf wp-content.tar.gz -C /home/naomiso/naomisophyblog.com.ng/wp-content/

    2. For .zip Files

    If your archive is a .zip file, use the unzip command:

    unzip wp-content.zip

    To extract to a specific folder:

    unzip wp-content.zip -d /home/naomiso/naomisophyblog.com.ng/wp-content/

    πŸ”§ Need to Install tar or unzip?

    If these commands are missing on your server, install them with:

    For Ubuntu

    sudo apt install tar
    sudo apt install unzip

    For AlmaLinux
    sudo yum install tar sudo yum install unzip

    βœ… Conclusion

    Now you know how to handle both .tar.gz and .zip files when working with WordPress backups on a Linux server. Always make sure you’re extracting into the correct directory and have the right permissions set for www-data or your web user.

    Need help with permissions or WordPress setup? Drop a comment below or contact our support.

  • Compressing wp-content Folder Using Linux Command Line (ZIP & TAR.GZ Guide)

    Compressing wp-content Folder Using Linux Command Line (ZIP & TAR.GZ Guide)

    To compress the wp-content folder via terminal, use one of the following commands depending on your preferred archive format:

    πŸ”Ή To compress as .zip:

    bash
    zip -r wp-content.zip wp-content

    πŸ”Ή To compress as .tar.gz (recommended for Linux):

    bash
    tar -czvf wp-content.tar.gz wp-content

    πŸ”Ή To compress as .tar (uncompressed tarball):

    bash
    tar -cvf wp-content.tar wp-content

    These commands should be run from the directory containing the wp-content folder.
    Let me know if you want to exclude any subfolders or files.

  • How to Rename a Website Folder Using Terminal

    How to Rename a Website Folder Using Terminal

    To rename the directory /home/naomisophy to /home/naomiso, follow the steps:

    sudo mv /home/naomisophy /home/naomiso

  • How to Download and extract WordPress via Terminal

    How to Download and extract WordPress via Terminal

    cd /tmp
    wget https://wordpress.org/latest.zip
    unzip latest.zip
    sudo mv wordpress/* /home/naomisophy/naomisophyblog.com.ng


    Replace this /home/naomisophy/naomisophyblog.com.ng with your website directory

  • How to Upload a File to Your Server via SCP from your window PC

    How to Open PowerShell on Windows

    You can open PowerShell easily using either a keyboard shortcut or the Start Menu. Here’s how:


    βœ… Method 1: Quick Keyboard Shortcut

    1. Press Windows Key + X

    2. From the menu, select Windows PowerShell or Terminal (Admin)

    πŸ” Use “Terminal (Admin)” if you need administrative privileges.


    βœ… Method 2: Using the Start Menu

    1. Click the Start Menu (Windows icon at the bottom-left)

    2. Type PowerShell

    3. Click on Windows PowerShell or Windows Terminal from the search results

    4. πŸ” Right-click and choose “Run as administrator” if needed


    πŸ§ͺ Example Command to Upload a File to Your Server via SCP

    After opening PowerShell, you can use this command to upload a file (e.g. a SQL backup) to your remote server:

    powershell
    scp "C:\Users\Multiplatforms\Downloads\Compressed\azzawaj_wp2dr5.sql.gz" root@161.97.68.33:/tmp/

    This command copies the file from your local Windows machine to the /tmp/ directory on your server.


    πŸ’‘ Note: Make sure:

    • You have OpenSSH Client installed (usually preinstalled on Windows 10/11)

    • Your server allows SSH access

    • You replace the file path and IP with the correct details if different

  • How to View All WordPress Users in Your Database Using Terminal

    How to View All WordPress Users in Your Database Using Terminal

    To see a list of all WordPress users in your database (zzle_wu3), you’ll need to run a SQL query on the wp_users table.

    🧾 MySQL Command:

    bash
    mysql -u root -p -e "SELECT ID, user_login, user_email, user_registered FROM zzle_wu.wp_users;"

    πŸ” You will be prompted to enter your MySQL root password.

    πŸ“‹ What This Displays:

    • ID: The unique identifier for each user.

    • user_login: The WordPress username.

    • user_email: The email address linked to the account.

    • user_registered: The date and time the user registered.

    βœ… Example Output:

    You can add \G at the end for vertical format if the output is too wide:

    bash
    mysql -u root -p -e "SELECT ID, user_login, user_email, user_registered FROM zzle_wu3.wp_users\G
  • Terminal: How to Change a WordPress User Password via MySQL (User: coic)

    πŸ” How to Change WordPress Admin Password via MySQL (User: coip)

    Last updated: July 3, 2025

    🧰 Requirements

    • Access to your Linux server (SSH or terminal)
    • MySQL root access or database credentials
    • WordPress database name: zzle_wu

    πŸ›  Resetting the Password Using MySQL

    Run the following command to reset the password for the user coic:

    mysql -u root -p -e "UPDATE zzle_wu.wp_users SET user_pass = MD5('favour2025') WHERE user_login = 'coip';"

    This command uses the MD5 hashing algorithm, which is required by older WordPress versions to store passwords in the database.

    ⚠️ Security Warning

    MD5 is outdated and no longer considered secure. Although WordPress still supports it, newer versions use stronger hashing algorithms like bcrypt.

    After logging in with the new password, it’s recommended to immediately update the password again through the WordPress dashboard or WP-CLI to ensure it’s rehashed securely.

    βœ… More Secure Alternative Using WP-CLI

    If WP-CLI is available on your server, use this command instead for modern hashing:

    wp user update coip --user_pass=favour2025

    This is the preferred and more secure method to reset a WordPress password.

    πŸ“Œ Tip: Always backup your database before performing manual operations.