Skip to content

Instantly share code, notes, and snippets.

@itsthatguy
Last active August 29, 2015 14:16
Show Gist options
  • Select an option

  • Save itsthatguy/dd510df1a275723d8825 to your computer and use it in GitHub Desktop.

Select an option

Save itsthatguy/dd510df1a275723d8825 to your computer and use it in GitHub Desktop.
Shows octal permissions for 'path(s)'
# Shows octal permissions for 'path(s)'
#
# example:
# $ octal /usr/local/foo myfile myotherfile
# 0644 /usr/local/foo
# 0500 myfile
# 0666 myotherfile
# OSX
alias octal="stat -f '%Mp%Lp %N' $*"
# Linux
alias octal="stat -c '0%a %n' $*"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment