CLI One-liners

File Operations Find and Replace Text sed -i 's/old-text/new-text/g' filename Replace all occurrences of ‘old-text’ with ’new-text’ in a file Quick File Search find . -name "*.txt" -type f -mtime -7 Find all .txt files modified in the last 7 days Move files with rsync and ssh rsync -avz -e "ssh -p 22" <source_file_or_dir> user@<remote_host>:/<remote_dir>/ Rsync via ssh. Port 22 is default but is added as a reminder that you might need to change to something else. ...

December 8, 2024 · 4 min · 682 words

Mosh: The Mobile Shell - Userland Remote Access with Tailscale

Mosh (Mobile Shell) is a userland remote terminal application that provides resilient connections surviving network changes and interruptions. Unlike traditional system daemons, Mosh runs entirely in userspace, providing natural security boundaries and simplified deployment. How Mosh Works Userland Architecture Mosh operates entirely in userspace, which is fundamentally different from traditional SSH: Initial Connection Uses existing SSH for authentication SSH launches mosh-server as your user (not root) Server picks available UDP port Communicates port and key back through SSH Local mosh-client establishes UDP connection Security Benefits ...

February 15, 2024 · 5 min · 907 words