Check These Out
If you add the -d flag each difference in the command's output will be highlighted.
I also monitor individual drives by adding them to df. Makes for a nice thin status line that I can shove to the bottom of the monitor.
In this example, where the users gpg keyring has a password, the user will be interactively prompted for the keyring password.
If the keyring has no password, same as above, sans the prompt. Suitable for cron jobs.
~/.gnupg/passwd/http-auth.gpg is the encrypted http auth password, for this particular wget use case.
This approach has many use cases.
example bash functions:
function http_auth_pass() { gpg2 --decrypt ~/.gnupg/passwd/http-auth.gpg 2>/dev/null; }
function decrypt_pass() { gpg2 --decrypt ~/.gnupg/passwd/"$1" 2>/dev/null; }
use imagemagik convert
Assumed dir A, B, C are subdirs of the current dir
Exact syntax of the command is:
rsync -v -r --size-only --compare-dest=/path_to_A/A/ /path_to_B/B/ /path_to_C/C/
(do not omit end-slashes, since that would copy only the names and not the contents of subdirs of dir B to dir C)
You can replace --size-only with --checksum for more thorough file differences validation
Useful switch:
-n, --dry-run perform a trial run with no changes made
This is usefull to diff 2 paths in branches of software, or in different versions of a same zip file. So you can get the real file diff.
Converts any number of seconds into days, hours, minutes and seconds.
sec2dhms() {
declare -i SS="$1"
D=$(( SS / 86400 ))
H=$(( SS % 86400 / 3600 ))
M=$(( SS % 3600 / 60 ))
S=$(( SS % 60 ))
[ "$D" -gt 0 ] && echo -n "${D}:"
[ "$H" -gt 0 ] && printf "%02g:" "$H"
printf "%02g:%02g\n" "$M" "$S"
}
Schedule your Mac to sleep at any future time.
Also wake, poweron, shutdown, wakeorpoweron. Or repeating with
$ sudo pmset repeat wakeorpoweron MTWRFSU 7:00:00
Query with
$ pmset -g sched
Lots more at http://www.macenterprise.org/articles/powermanagementandschedulingviathecommandline
Sorts a character string, using common shell commands.