From 60eff9308c8240b1dfa54f17184434f3e3b7067a Mon Sep 17 00:00:00 2001 From: Carl Unsworth Date: Fri, 7 Mar 2014 14:29:10 -0800 Subject: [PATCH] - Cheatsheets added for a couple of my favourite commands: - rsync: file copy and backup multi-tool - indent: one liner to nicely format C/C++ source. --- cheatsheets/indent | 2 ++ cheatsheets/rsync | 6 ++++++ 2 files changed, 8 insertions(+) create mode 100644 cheatsheets/indent create mode 100644 cheatsheets/rsync diff --git a/cheatsheets/indent b/cheatsheets/indent new file mode 100644 index 0000000..d8568e6 --- /dev/null +++ b/cheatsheets/indent @@ -0,0 +1,2 @@ +# format C/C++ source according to the style of Kernighan and Ritchie (K&R), no tabs, 3 spaces per indent, wrap lines at 120 characters. +indent -i3 -kr -nut -l120 diff --git a/cheatsheets/rsync b/cheatsheets/rsync new file mode 100644 index 0000000..617bf74 --- /dev/null +++ b/cheatsheets/rsync @@ -0,0 +1,6 @@ +# copy files from remote to local, maintaining file propertires and sym-links (-a), zipping for faster transfer (-z), verbose (-v). +rsync -avz host:file1 :file1 /dest/ +rsync -avz /source host:/dest + +# Copy files using checksum (-c), rather than time, to detect if the file has changed. (Useful for validating backups). +rsync -avc /source/ /dest/