Skip to content

Instantly share code, notes, and snippets.

@tonejito
Last active June 9, 2017 22:23
Show Gist options
  • Save tonejito/7720e599911ed5664c4447c074fd7478 to your computer and use it in GitHub Desktop.
Save tonejito/7720e599911ed5664c4447c074fd7478 to your computer and use it in GitHub Desktop.
Get special files with ACL or Capabilities
#!/bin/bash
# https://superuser.com/a/398470
# https://superuser.com/a/1188867
GETFACL=/usr/bin/getfacl
GETCAP=/sbin/getcap
PATH_DIRS=$(echo $PATH | tr ':' ' ')
case ${1}
in
acl)
$GETFACL -Rsp $PATH_DIRS
;;
cap|capabilities)
$GETCAP -r $PATH_DIRS
;;
*)
echo "Usage: ${0} <acl> | <capabilities>"
exit -1
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment