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