This guide compiles common software installation syntax and advanced command-line references across UNIX-like operating systems running Linux (including but not limited to Debian, Ubuntu, and CentOS).

These are practical commands I frequently rely on while self-hosting and managing Linux environments for WordPress websites, serving as a handy quick-reference for system administrators and webmasters alike.

Table of Contents:

Common Basic Linux Commands

  • File editor: nano (Ctrl + X to exit/save)
  • Create directory: mkdir
  • Delete files and directories: rm filename (-r: recursively include files inside directories)
  • Download files via network: wget https://www.vedfolnir.com/favicon (-NCR)
  • Rename or move file/directory: mv vedfolnir mountos
  • Install package: apt-get install unzip
  • List installed packages: dpkg -l | grep PackageName
  • Remove package completely: apt-get remove --purge PackageName
  • Update package repositories / upgrade packages: apt-get update (apt-get upgrade)
  • Add new user: adduser UserName
  • Edit sudoers privileges: visudo
  • Redirect command output to a text file: command > /tmp/vedfolnir.txt
  • Clean obsolete downloaded archive packages: apt-get autoclean
  • Clean all downloaded package caches: apt-get clean
  • Copy files and directories preserving attributes: cp -Rp files_directory_name_from/* /files_directory_name_to/
  • Change file and directory ownership: chown -R name:name files_directory_name
  • Change file and directory permissions: chmod 777 files_directory_name
  • View user login history: last
  • Check Linux distribution info: cat /etc/*-release
  • Check Linux kernel version: uname -r
  • Search for file names: find / -name index.html, locate filename, whereis filename

Network Status Diagnostics Commands

  • Inspect socket connections and processes: ss -nap
  • Count total active connections:
    netstat -an | wc -l
  • Count active HTTP connections on port 80:
    netstat -an | grep :80 | wc -l
  • Identify IP addresses failing SSH authentication:
    lastb
    lastb | awk '{ print $3}' | sort | uniq -c | sort -n
  • Show server IP address:
    ifconfig eth0 | grep inet | awk '{ print $2 }'
  • Check server host connectivity:
    ping IPAddress

Apache Web Server Commands

  • Inspect enabled modules:
    apachectl -t -D DUMP_MODULES
    httpd -v # (for RedHat/CentOS)

File Transfer: vsftpd

  • Install vsftpd:
    sudo apt-get install vsftpd

Server Hardware Status Commands

  • Check CPU core count:
    grep processor /proc/cpuinfo | wc -l
  • Query CPU architecture details:
    lscpu
  • Real-time system monitoring:
    top
    htop
  • Benchmark disk write speed:
    dd if=/dev/zero of=bigfile bs=1M count=500 # run under /dev/shm to benchmark RAM disk speed
  • Display disk space usage:
    df -m
  • Display directory space usage:
    du -sm
    du -s * | sort -rn | head -5 # list top 5 largest directories/files
  • Check if a specific service is running with systemctl:
    systemctl status <service_name>
  • Check if a specific process is running:
    ps aux | grep <process_name>
  • Check server uptime and load averages:
    uptime

Memory Management Commands

  • free -m: Displays server memory usage, buffers, and cache in megabytes.
  • top: Lists all running processes ranked by memory and CPU consumption.

Compression and Archive Utilities

  • 7-Zip (p7zip)

    • Installation:
      sudo apt-get install p7zip-full
    • Extraction:
      7z x zipfile.zip
  • Tar

    • Compression:
      tar zcvf FileName.tar.gz DirectoryName
    • Decompression:
      tar -xzvf file.tar.gz

SQL Database Management Commands

  • Delete WordPress post metadata matching a search pattern:
    DELETE FROM wp_postmeta WHERE meta_key like '_vedfolnir%';
✦ Independent Journalism · Reader Support ✦

Support Independent Perspectives & In-Depth Insights

Every thoughtful analysis and candid critique comes from our dedication to truth and quality. We choose not to follow sensational algorithms or clickbait headlines.

Sustaining independent research requires reader support. Make a one-time or monthly contribution, securely processed by Google.

Payments secured by Google · Manage or cancel anytime in your Google Account