Extras
Command cheat sheet
Connecting
| Do this |
Command |
Where |
| Connect to the server |
ssh homeserver |
Mac / PC |
| Leave the server |
exit |
server |
| Copy a file to the server |
scp photo.jpg homeserver:~/ |
Mac / PC |
| Copy a file from the server |
scp homeserver:~/report.txt . |
Mac / PC |
Looking around (safe, changes nothing)
| Question |
Command |
| Which computer am I on? |
hostname |
| Which folder am I in? |
pwd |
| What's in this folder? |
ls -l |
| Show a text file |
cat FILE or less FILE (Q quits) |
| Disk space |
df -h |
| Memory |
free -h |
| CPU / memory live |
htop (Q quits) |
| Disks and drives |
lsblk -o NAME,SIZE,MODEL,FSTYPE,MOUNTPOINTS |
| Network address |
ip -brief address |
| Is a service running? |
systemctl is-active NAME (e.g. ssh, smbd, tailscaled) |
| Recent errors of a service |
sudo journalctl -u NAME -n 30 |
| Temperature |
sensors |
Changing things
| Do this |
Command |
| Install software |
sudo apt install NAME |
| Update everything now |
sudo apt update && sudo apt upgrade |
| Edit a file |
nano FILE (system files: sudo nano FILE) |
| Restart a service |
sudo systemctl restart NAME |
| Restart the server |
sudo reboot |
| Shut down the server |
sudo poweroff (you'll need to press its power button to start it again) |
AI
| Do this |
Command |
Where |
| Is the model running? |
systemctl is-active llama-model |
server |
| Model health |
curl -s http://127.0.0.1:8095/health |
server |
| Restart the model |
sudo systemctl restart llama-model |
server |
| Model log |
sudo journalctl -u llama-model -n 50 |
server |
| Switch model |
edit /etc/ai-runtime/model.env, then restart |
server |
| Open the chat tunnel |
ssh -N -L 18095:127.0.0.1:8095 homeserver |
Mac / PC |
| Search documents |
recollq -c ~/.recoll-docs -A -p 2 -n 5 WORDS |
server |
| Update the search index |
recollindex -c ~/.recoll-docs |
server |
| Ask about pages |
~/bin/ask-pages FILE.pdf 3 5 "question" |
server |
| Agent system status |
systemctl --user is-active aisystem |
server |
| Agent dashboard tunnel |
ssh -N -L 18765:127.0.0.1:8097 homeserver |
Mac / PC |
Nano editor
| Key |
Does |
| Ctrl+O then Enter |
Save |
| Ctrl+X |
Exit |
| Ctrl+W |
Search |
| Ctrl+K |
Cut a line |
| Ctrl+U |
Paste |
Dangerous: only when a chapter tells you to
mkfs, parted, wipefs, dd, rm -r: these erase things. Always check the disk or folder name twice.