Last active
January 3, 2016 13:29
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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