Bash Tidbits

Just some bits of bash code that I don't want to look up ever again.

SSH into server

ssh USER_NAME@your_host.tld  
# enter password  
# Though you should probably setup SSH keys  

RSYNC - upload files from local computer to server

See Digital Ocean's article for more (& better) information.


  • Use path1/ to only pass the contents of path1 instead of uploading the full directory.

Do a dry run & check what gets sent.

rsync -anv path1/ path2

Push to server

rsync -a PATH1/ username@remote_host:destination_directory