From 4b1381e99d1388de5d5cbcc5db9d83f400de12aa Mon Sep 17 00:00:00 2001 From: Dominik Porada Date: Thu, 2 Aug 2012 00:33:33 +0300 Subject: .aliases: Make `fs` work with both GNU `stat` and OS X `stat` --- .aliases | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to '.aliases') diff --git a/.aliases b/.aliases index 5090499..72ed818 100644 --- a/.aliases +++ b/.aliases @@ -75,7 +75,13 @@ alias c="tr -d '\n' | pbcopy" alias cleanup="find . -type f -name '*.DS_Store' -ls -delete" # File size -alias fs="stat -c \"%s bytes\"" +if stat -c '' . > /dev/null 2>&1; then + # GNU `stat` + alias fs="stat -c \"%s bytes\"" +else + # OS X `stat` + alias fs="stat -f \"%z bytes\"" +fi # ROT13-encode text. Works for decoding, too! ;) alias rot13='tr a-zA-Z n-za-mN-ZA-M' -- cgit v1.2.3