Real-World Examples for in

February 1, 2026 ยท View on GitHub

This document contains 50+ real-world examples of using in to manage microservices, multi-repo setups, and directory groups.

Git Operations

  1. Check status across all repos

    in * git status -s
    

    Quickly see which microservices have uncommitted changes.

  2. Pull latest changes everywhere

    in -P 4 * git pull origin main
    

    Update all repos in parallel (4 at a time).

  3. Checkout a specific branch if it exists

    in * "git checkout feature/login || git checkout main"
    

    Try to switch to feature branch, fallback to main.

  4. Create a new release branch

    in services/* git checkout -b release/v2.0
    
  5. Prune deleted remote branches

    in * git fetch -p
    
  6. See last commit in every repo

    in * "git log -1 --format='%h %s'"
    
  7. Stash changes across all services

    in services/* git stash
    
  8. Discard all local changes (Danger!)

    in * git reset --hard HEAD
    
  9. Tag a release across multiple packages

    in packages/* git tag v1.0.0
    
  10. Push tags

    in packages/* git push origin v1.0.0
    

Node.js / JavaScript

  1. Install dependencies (clean install)

    in -P 4 packages/* npm ci
    
  2. Update a specific package everywhere

    in * "pnpm update lodash"
    
  3. Run tests for a specific scope

    in packages/* npm test
    
  4. Check for outdated dependencies

    in services/* npm outdated
    
  5. Audit for vulnerabilities

    in * npm audit --production
    
  6. Build all frontend apps

    in apps/web-* npm run build
    
  7. Remove node_modules (Fresh start)

    in * "rm -rf node_modules package-lock.json"
    
  8. Initialize new projects

    in * npm init -y
    
  9. Run a custom script if it exists

    in * "npm run lint || echo 'No lint script found'"
    
  10. Upgrade interactive (using shell features)

    in * "ncu -u && npm install"
    

Docker & Microservices

  1. Build all Docker images

    in -P 2 services/* docker build -t my-app/service .
    

    Note: This builds them all with the SAME tag name, usually you want dynamic tags.

  2. Docker build with dynamic directory name

    in services/* "docker build -t app/\$(basename \$PWD) ."
    

    Uses shell expansion to tag image with directory name.

  3. Stop specific containers

    in services/auth,services/user docker-compose down
    
  4. Restart services

    in * "docker-compose restart app"
    
  5. View logs tail

    in services/* "tail -n 10 logs/service.log"
    
  6. Clean up Docker artifacts

    in * docker system prune -f
    

File Management & Cleanup

  1. Delete temporary files

    in * "rm -rf dist/ .cache/ tmp/"
    
  2. Find large files

    in * "find . -type f -size +100M"
    
  3. Count lines of code

    in src/* "wc -l *.ts"
    
  4. Replace string in files (Sed)

    in * "sed -i 's/foo/bar/g' config.yaml"
    
  5. Rename a config file

    in * "mv config.local.json config.json"
    
  6. Create missing directories

    in * mkdir -p .github/workflows
    
  7. Copy a standard file to all repos

    in * cp ~/templates/LICENSE .
    

System & Diagnostics

  1. Check disk usage of directories

    in * du -sh .
    
  2. Check active ports (Mac/Linux)

    in * "lsof -i -P | grep LISTEN"
    
  3. Verify standard file existence

    in * "[ -f README.md ] && echo 'OK' || echo 'Missing README'"
    
  4. Print current version from package.json

    in * "jq .version package.json"
    
  5. Check python version

    in services/* python --version
    

Advanced Scripting

  1. Chain multiple failures

    in * "lint || echo 'Lint failed' >> errors.log"
    
  2. Conditional execution based on file presence

    in * "if [ -f requirements.txt ]; then pip install -r requirements.txt; fi"
    
  3. Run a local script in remote directories

    in services/* ~/scripts/health-check.sh
    
  4. Grep across multiple repos

    in * "grep -r 'TODO' src/ | head -n 5"
    
  5. Generate a report

    in * "echo \"\$(basename \$PWD): \$(git rev-parse HEAD)\" >> ~/report.txt"
    
  6. Export ENV vars per command

    in * "NODE_ENV=production npm run build"
    

Python

  1. Install requirements

    in services/* pip install -r requirements.txt
    
  2. Format code

    in * black .
    
  3. Run Pytest

    in -P 4 * pytest
    

Terraform / Infrastructure

  1. Format TF files

    in infra/* terraform fmt
    
  2. Validate configurations

    in infra/* terraform validate
    
  3. Plan changes

    in infra/stacks/* "terraform plan -out=tfplan"