Back to Parent
Commands.md

Useful Commands

Aliases

ufwlog -> sudo tail -f /var/log/ufw.log
dps -> docker ps --format "table {{.Names}}\t{{.Image}}\t{{.Status}}\t{{.Ports}}"

Docker

Check running containers

Standard command:

docker ps

Custom alias (cleaner table output):

dps

Definition: docker ps --format "table {{.Names}}\t{{.Image}}\t{{.Status}}\t{{.Ports}}"

View Logs

tail the last 100 lines and follow:

docker logs -f --tail 100 <container_name>

Restart a service

Inside the service directory:

docker compose restart <service_name>

Update a container

  1. Pull new image:
    docker compose pull
    
  2. Recreate container:
    docker compose up -d
    
  3. Remove old images:
    docker image prune
    

System

Update System

sudo apt update && sudo apt upgrade -y

Check Disk Usage

df -h