Linux - Aliases#

Quick Setup (Apply Aliases to Any Linux Machine):

  1. Open your bash configuration file:
    nano ~/.bashrc
  2. Append the following alias block to the bottom of the file:
    # --- Homelab Linux Aliases ---
    # System Listings
    alias ll='ls -alF'
    alias la='ls -A'
    alias l='ls -CF'
    
    # Docker & Docker Compose
    alias up='docker compose up'
    alias down='docker compose down'
    alias clean='docker system prune --all --volumes'
    
    # 1Password CLI Compose Integration
    alias 1p='op whoami >/dev/null 2>&1 || eval $(op signin); op run --env-file=".env" -- docker compose up'
    
    # Hugo Site Publishing (NAS-Mounted Scripts)
    alias push='bash /mnt/Software/Software/Scripts/Linux/publish-hugo-homelab.sh && tail -f /home/marc/hugo/homelab/logs/publish-hugo-homelab.log'
    alias pushgen='bash /mnt/Software/Software/Scripts/Linux/publish-hugo-gendash.sh && tail -f /home/marc/hugo/gendash/logs/publish-hugo-gendash.log'
    # -----------------------------
  3. Save, exit, and reload the configuration:
    source ~/.bashrc

1. Core Alias Reference#

These aliases are designed to standardise navigation, Docker compose stacks, and Hugo website publishing across Linux servers.

📋 Alias Descriptions & Prerequisites:#

  • ll / la / l: Standardised listing commands for quick directory navigation.
  • up / down: Shortcuts to run standard Docker Compose builds and stacks.
  • clean: Executes docker system prune --all --volumes to perform a complete cleanup of unused Docker caches and volumes.
  • 1p (Prerequisite: 1Password CLI installed & configured):
    • Automatically authenticates you to the 1Password CLI (op), then boots your Docker Compose stack while securely injecting environment keys defined in 1Password.
  • push / pushgen (Prerequisite: NAS mount /mnt/Software configured):
    • Executes the Hugo publishing scripts mirrored from the Mac Studio and automatically displays the live build logs.