Working papers · speech, health & trustworthy AIVigo, 2026

Writing /

The 10% of the terminal that solves 90% of the job

In one sentence

The four terminal skills you will use the most: moving around without a GUI, SSH with an alias for you and your coding agent, tmux, and watching the CPU and the GPU.

Servers, deployments, remote GPUs, agents like Claude Code or Codex: it all happens in the terminal. This tutorial gives you the four skills you will use the most, until you can do them from memory:

  1. Move around a machine without a GUI: pwd, ls, cd, nano.
  2. Get into another machine and move files: ssh, scp.
  3. Keep jobs running after you disconnect: tmux.
  4. See what is going on: top, nvidia-smi.

We’ll follow one night on call. It is 2:47 and an alert comes in: the overnight Whisper training run on the gpu server has died with CUDA out of memory. Each section is one step of the fix and ends with a 30-second challenge. At the end there is a PDF cheat sheet with every command.

1. Moving around without a GUI

First, on your laptop: lower the batch_size in the config before launching again.

pwd                       # where am I?
ls                        # what is here?
cd projects/whisper       # go in, relative to where you are
cd configs                # and one level further
nano train.yaml           # edit: Ctrl-O and Enter save, Ctrl-X exits
cd ..                     # up one level: back in whisper
username@laptop:~$pwd/home/username username@laptop:~$lsDownloads notes.txt projects username@laptop:~$cd projects/whisperusername@laptop:~/projects/whisper$ username@laptop:~/projects/whisper$lsconfigs data train.py username@laptop:~/projects/whisper$cd configsusername@laptop:~/projects/whisper/configs$nano train.yaml Ctrl-O Enter Ctrl-Xusername@laptop:~/projects/whisper/configs$ username@laptop:~/projects/whisper/configs$cd ..username@laptop:~/projects/whisper$pwd/home/username/projects/whisper ◀ here ◀ here ◀ here ◀ here / home username = ~ Downloads notes.txt projects whisper configs train.yaml data train.py GNU nano train.yaml model: whisper-small batch_size: 32 batch_size: 16 lr: 1.0e-5 epochs: 10 [ Wrote 4 lines ] ^O Write Out ^X Exit
Figure 1. The terminal is always in a folder. pwd gives the path from the root (the thick line), ls lights up what is inside and cd moves the marker. nano edits without leaving the terminal.
  • Every path that does not start with / or ~ is relative to the folder you are in. If a command cannot find a file, the first thing to run is pwd.
  • ~ is your home folder (/home/username) and / is the root of everything. cd ~ takes you home from wherever you are.
  • Tab completes names: cd pro and Tab. It is the shortcut that saves the most time.

Windows: in PowerShell, pwd, ls and cd work the same. notepad train.yaml opens the file in Notepad, in a window; to edit inside the terminal, use nano in WSL.

30-second challenge. From ~, go into a project, list what is there, change one line of a file with nano, save and go back to ~. No mouse.

2. Getting into other machines (you and your agent)

The config is fixed, but the training lives on gpu. You have to get there and take it with you. This part you set up once:

ssh-keygen -t ed25519           # creates your key pair; give it a passphrase
ssh-copy-id username@10.0.3.7   # leaves the public key on the server
nano ~/.ssh/config              # and gives it a short name
Host gpu
    HostName 10.0.3.7
    User username

And this is the everyday part:

ssh gpu                                         # get in
scp configs/train.yaml gpu:~/whisper/configs/   # send a file
scp gpu:~/whisper/logs/train.log .              # bring one back
exit                                            # get out
username@laptop:~$ssh-keygen -t ed25519Your identification has been saved in ~/.ssh/id_ed25519Your public key has been saved in ~/.ssh/id_ed25519.pub username@laptop:~$ssh-copy-id username@10.0.3.7…continue connecting (yes/no/[fingerprint])? yesusername@10.0.3.7's password:Number of key(s) added: 1 username@laptop:~$nano ~/.ssh/configHost gpu HostName 10.0.3.7 User username username@laptop:~$ssh gpu username@laptop:~$ssh gpuWelcome to Ubuntu 24.04 LTSusername@gpu:~$ username@gpu:~$exit~/projects/whisper$scp configs/train.yaml gpu:~/whisper/configs/train.yaml 100% 412 1.2KB/s 00:00 ● Bash(ssh gpu nvidia-smi) └ 9520MiB / 24576MiB● The GPU has about 15 GB free; another process holds 9 GB. laptop ~/.ssh/ id_ed25519 · private id_ed25519.pub · public config Host gpu HostName 10.0.3.7 User username gpu · 10.0.3.7 authorized_keys username · public sshd ✓ username bash username@gpu whisper/configs/train.yaml encrypted channel signature agent on the laptop claude uses ~/.ssh/config ssh gpu nvidia-smi
Figure 2. The private key never leaves the laptop. The connection is encrypted first; inside it, the laptop signs with the private key and the server checks the signature against the public key it keeps. If it matches, you are in. No password travels. Your agent uses the same alias and the same key.
  • The first time you connect, SSH shows the server’s fingerprint and asks yes/no. Answer yes only if it matches the one you get from whoever runs the machine.
  • scp source destination, always in that order. The remote side has gpu: in front.
  • If you have to go through another machine to get there, add ProxyJump bastion to the Host block.

Your agent uses the same alias

Claude Code and Codex run commands in your terminal, so they inherit your ~/.ssh/config. You can ask them “check with ssh gpu nvidia-smi how much memory is free” and they will, usually after asking for permission. Keep in mind that they log in as you:

  • Whatever your user can do on gpu, the agent can too. If you want it to be able to do less, give it its own Host gpu-agent block, with a user without sudo and its own key.
  • It can use any key in your ~/.ssh, not just the one for gpu. Keep production keys off the machine the agent works on.
  • Keep manual approval for ssh, scp and rsync, and never pick “always allow” for ssh gpu: anything can follow the host name.

Windows: OpenSSH ships with Windows 10 and 11, and ssh, scp and ssh-keygen work in PowerShell. The config lives in C:\Users<you>.ssh\config. ssh-copy-id does not exist; instead: type $env:USERPROFILE.ssh\id_ed25519.pub | ssh username@10.0.3.7 “mkdir -p ~/.ssh && chmod 700 ~/.ssh && cat >> ~/.ssh/authorized_keys”.

30-second challenge. Create an alias for a machine you log into often, get in with ssh <alias>, get out and bring a file back with scp.

3. Keeping jobs running: tmux

You are on gpu with the new config. If you just launch the training again and the VPN drops, it dies with you.

tmux new -s train      # opens a named session
python train.py        # launch whatever you need
Ctrl-b  d              # you leave; it keeps running
tmux ls                # list sessions
tmux attach -t train   # you come back
username@laptop:~$ssh gpuusername@gpu:~$cd whisperusername@gpu:~/whisper$ username@gpu:~/whisper$python train.pyepoch 1/10 · loss 2.31 epoch 2/10 · loss 1.87client_loop: send disconnect: Broken pipeusername@laptop:~$ username@laptop:~$ssh gpuusername@gpu:~$cd whisperusername@gpu:~/whisper$tmux new -s train username@gpu:~/whisper$python train.pyepoch 1/10 · loss 2.31 epoch 3/10 · loss 1.52Ctrl-b d[detached (from session train)] username@gpu:~/whisper$exitConnection to gpu closed.username@laptop:~$ username@laptop:~$ssh gpuusername@gpu:~$tmux attach -t trainepoch 8/10 · loss 0.94 Ctrl-b dusername@gpu:~$cd whisperusername@gpu:~/whisper$tmux new -s claude username@gpu:~/whisper$claude "why did the 2:41 run fail?"● reading logs/train.log… laptop >_ >_ zzzlid closed gpu server × connection lost bash python train.py epoch 1/10epoch 2/10 ✕ SIGHUP: the job dies tmux · train detached bash python train.py epoch 1/10epoch 3/10epoch 5/10epoch 8/10epoch 9/10still running still running tmux · claude claude reading logs/train.log…
Figure 3. Without tmux, the process hangs from your connection: when it drops, the process gets SIGHUP and ends. Inside tmux it hangs from the tmux server, which lives on the machine, so you can leave, close the laptop and come back.
  • Ctrl-b is the prefix: press it, let go, then press the other key.
  • If you want more: Ctrl-b % splits the screen into two panes and Ctrl-b plus an arrow moves you between them.

A session for your agent

tmux new -s claude
claude                 # or codex

Give it the task (“why did the 2:41 run fail?”), leave with Ctrl-b d and come back whenever you like. If it needs permission for something, it will be waiting for you there. Note that, launched on the server, your agent’s credentials stay on it. Do it only on machines you trust, and without options that skip approvals.

Windows: tmux does not exist on Windows. Use it inside WSL or, better, on the Linux server you reach over SSH, which is where it matters.

30-second challenge. Create a session, run sleep 300, leave, check with tmux ls that it is still alive and go back in.

4. Seeing what is going on: top and nvidia-smi

The training is running. But why did it run out of memory with batch 32?

top                         # CPU and memory per process; q to quit
nvidia-smi                  # GPU: memory, utilization and who holds it
watch -n 1 nvidia-smi       # the same, every second
ps -o user=,args= -p 2290   # whose is it, and what is it?
kill 2290                   # ends a process by its PID
username@gpu:~$topload average: 7.82 Tasks: 214 %Cpu(s): 91.3 us qusername@gpu:~$nvidia-smi username@gpu:~$ps -o user=,args= -p 2290username python3 -m ipykernel_launcher -f …username@gpu:~$kill 2290 username@gpu:~$watch -n 1 nvidia-smiEvery 1.0s: nvidia-smi CPU · top PID %CPU COMMAND 4127 610 python3 4133 97 python3 2290 1 python3 GPU · nvidia-smi memory 23.4 / 24 GB 14.1 / 24 GB use 97 % PID PROCESS MEM 4127 /usr/bin/python3 14.1 GB 2290 /usr/bin/python3 9.3 GB 2290 /usr/bin/python3 9.3 GB ← and this? ⟳ every 1 s
Figure 4. top sorts by CPU, and a process that only uses the GPU barely shows. nvidia-smi shows which PIDs hold the memory, even if both are called python3; ps tells you 2290 is a Jupyter kernel forgotten in the afternoon, with 9 GB. With it there, batch 32 did not fit. Illustrative figures.
  • Before kill, check whose process it is with ps. If it is not yours, ask before touching it.
  • htop, if it is installed, is top with colours and easier to read.

Windows: Task Manager is your top; in PowerShell, Get-Process | Sort-Object CPU -Descending | Select-Object -First 10 lists the processes that have used the most CPU time. nvidia-smi comes with the NVIDIA driver and works the same.

30-second challenge. In a tmux session, open watch -n 1 nvidia-smi in one pane while you train in the other.

3:20

Training relaunched, GPU free and the agent going through the log. Time for bed.

Download the PDF cheat sheet: one page with the commands of the four sections, to keep at hand or print.

Practise in the lab: a Google Colab notebook with a real SSH server and a hidden flag in each section.

To keep going: tldr pages gives the most common use of each command, explainshell takes apart any line you come across, MIT’s The Missing Semester covers everything a degree takes for granted, and Julia Evans’s zines explain it with drawings.