📦 Docker, npm and pip commands cheat sheet you can copy
Containers and package managers have a lot of commands, but you use maybe a dozen of them daily. Here are those, ready to paste.
Some commands remove containers, images or volumes. Check what you are removing first. Save the pack to CopyCat to keep these one click away.
docker ps --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}"
Follow container logs
docker logs -f --tail 100 [container]
Shell inside a container
docker exec -it [container] sh
Compose up and rebuild
docker compose up -d --build
Compose logs for one service
docker compose logs -f [service]
Stop everything and clean volumes
docker compose down -v
Free up Docker disk space
docker system prune -af --volumes
Clean reinstall of node modules
rm -rf node_modules package-lock.json && npm install
Run one npm script in a workspace
npm run [script] -w [package-name]
Python virtual environment
python3 -m venv .venv && source .venv/bin/activate && pip install -r requirements.txt
Kill a stuck dev server
npx kill-port [3000]
Check Node and package versions
node -v && npm -v && npm ls --depth=0
More template packs