aboutsummaryrefslogtreecommitdiffstats
path: root/.aliases
diff options
context:
space:
mode:
authorDominik Porada <porada@me.com>2012-08-02 00:33:33 +0300
committerMathias Bynens <mathias@qiwi.be>2012-08-01 23:59:02 +0200
commit4b1381e99d1388de5d5cbcc5db9d83f400de12aa (patch)
treebcbdcc80d22bc136d23cf3ebd7031340a06af151 /.aliases
parent7d9a9f2e707d4ee617b3521ac245007bde7f4490 (diff)
downloaddotfiles-4b1381e99d1388de5d5cbcc5db9d83f400de12aa.tar.gz
dotfiles-4b1381e99d1388de5d5cbcc5db9d83f400de12aa.tar.bz2
dotfiles-4b1381e99d1388de5d5cbcc5db9d83f400de12aa.zip
.aliases: Make `fs` work with both GNU `stat` and OS X `stat`
Diffstat (limited to '.aliases')
-rw-r--r--.aliases8
1 files changed, 7 insertions, 1 deletions
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'