tellsiddh's blog

6 min read

My Terminal Workflow

  • tech
  • terminal
  • fish
  • git
  • macos

I’ve collected and used thousands of terminal commands through actual DevOps, AI/ML, data science, full-stack web development, and cloud engineering work.

This post captures the most frequently used, most impactful, and uniquely powerful commands from that experience. Each one has been battle-tested in real engineering environments.

Setup & Shell Enhancements

Switch to the fish shell (Friendly Interactive Shell)

brew install fish
which fish
sudo sh -c 'echo /opt/homebrew/bin/fish >> /etc/shells'
chsh -s /opt/homebrew/bin/fish
fish

Fish gives you autosuggestions, syntax highlighting, and sane defaults out of the box.

Install Core Tools

brew install git htop jq wget tree curl tmux

These are the essentials for terminal power users.

Add to PATH in fish

fish_add_path /opt/homebrew/bin/

fish_add_path stores the path in a universal variable, so it persists across sessions without touching config.fish.

Use alias for shortcuts

alias gs="git status"
alias ll="ls -lah"
alias gc="git commit -m"
alias gco="git checkout"

Save these to ~/.config/fish/config.fish so they load in every new shell:

nano ~/.config/fish/config.fish

Git: Daily Driver for Projects

These are the git commands that show up repeatedly across dev workflows:

git clone [email protected]:user/project.git
git checkout -b feature/my-branch
git switch branch-name
git commit -m "meaningful message"
git push --set-upstream origin branch-name
git stash
git stash pop
git reset HEAD~1
git log --oneline --graph --all

Create and jump to a new feature branch:

git checkout -b fix/critical-issue

View status or the working diff:

git status
git diff

Python Development Workflows

Create isolated environments with conda:

conda create -n myenv python=3.10
conda activate myenv
conda install numpy pandas jupyter

Run scripts:

python my_script.py
python -m http.server

Profile performance:

python -m cProfile -s cumulative script.py

Use tuna to visualize import times:

pip install tuna
python -X importtime script.py 2> import.log
tuna import.log

Networking, SSH & System Tools

SSH with custom keys

ssh -i ~/.ssh/id_rsa user@host

Copy your public key to a host:

ssh-copy-id user@host

Diagnose DNS, IP, Connectivity

ping google.com
dig example.com
nslookup example.com
ifconfig | grep broadcast

Find your local IP on macOS:

ipconfig getifaddr en0

Scan network devices

sudo nmap -sn 192.168.1.0/24

Package Managers

Homebrew (macOS)

brew install wget git jq
brew update
brew upgrade

pip & Python packages

pip install package-name
pip uninstall package-name
pip freeze > requirements.txt
pip install -r requirements.txt

File and Text Utilities

Search history

history | grep "ssh"

Grep for content in files

grep -r "keyword" .
grep "error" logs.txt

Recursive file ops

find . -name "*.py"
find . -type f -exec cat {} +

Disk space

df -h
du -sh *

Clear the terminal

clear

Or press Ctrl + L.

System Monitoring

htop

htop

Better than top: it shows processes, memory, swap, threads, and more. It’s already installed from the core tools step above (sudo apt install htop on Debian/Ubuntu).

Check ports

lsof -i :8000
sudo lsof -i -P | grep ':8080'

Kill a process by PID:

kill -9 <PID>

Automation Scripts

Make a Python file executable:

chmod +x script.py
./script.py

Zip a folder:

zip -r archive.zip folder/

Unzip:

unzip file.zip

APIs & Web Tools

curl with headers

curl -X POST https://api.example.com/endpoint \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"key":"value"}'

Upload to a pre-signed S3 URL

curl -X PUT "$SIGNED_S3_URL" \
  -H "Content-Type: application/pdf" \
  --upload-file ./file.pdf

Audio Tools (AI & Speech)

TTS using llama.cpp

This needs a working llama.cpp build; the llama-tts binary does the rest.

llama-tts --tts-out-default -p "Hello world" && ffplay output.wav -nodisp -autoexit

Stream via a Flask API:

curl -X POST http://localhost:5000/tts \
  -H "Content-Type: application/json" \
  -d '{"text": "Welcome to the demo"}' \
  --output output.wav

Infrastructure & Cloud

Terraform

terraform init
terraform plan -out=tfplan
terraform apply tfplan
terraform destroy

Target specific modules:

terraform apply -target=module.my_module

AWS CLI

aws configure
aws s3 ls
aws lambda invoke --function-name my-func out.txt

Run LocalStack for local AWS emulation:

LOCALSTACK_AUTH_TOKEN=dummy localstack start

High-impact One-liners

Re-run the last command with sudo

In bash or zsh:

sudo !!

!! doesn’t work in fish because fish has no history expansion. Use the history variable instead, or press Alt + S to prepend sudo to the previous command:

sudo $history[1]

View the last 100 commands

history | tail -n 100

Git reset & clean

Throws away all uncommitted changes and untracked files, so be sure before you run it:

git reset --hard HEAD
git clean -fd

Miscellaneous Yet Powerful

Serve the current directory over HTTP

python3 -m http.server 8000

Set environment variables

export AWS_PROFILE=default
export OPENAI_API_KEY=your-key

In fish, use set -x instead:

set -x AWS_PROFILE default

Decode a JWT payload

echo "<JWT_PART_2>" | base64 --decode

Final Words

These commands reflect months of actual engineering activity, not just tutorials. If you found this useful:

Stay curious and keep building! Siddharth