Terminal Cheatsheet

Set default directory when ssh’ing into a server

Set default directory when ssh’ing into a server: Add cd /dir/to/start/in to .bashrc on the server

Merge one directory into another: rsync -a /src/ /destination/

Search for occurrences of a string in a directory and it’s sub directories but only output the filename, useful if the string you’re searching for is found in a log because it will prevent the string being output a gazillion times: grep -rl "string to search for" ./dir/to/search

Return to Mr Mad Hat homepage