Skip to content

Instantly share code, notes, and snippets.

@inodb
Last active January 3, 2016 13:29
Show Gist options
  • Save inodb/8470322 to your computer and use it in GitHub Desktop.
Save inodb/8470322 to your computer and use it in GitHub Desktop.
Get all the access rights of a file or directory. Use like rightpath /path/to/file.txt, or rightpath /path/to/directory
#!/bin/sh
rightpath() {
path=""
for d in `readlink -f $1 | tr / " "`
do
path="$path/$d"
stat -c "%A %a %U %G %n" $path
done | column -t
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment