Per is a simple utility that can verbosely print unix permissions and convert between symbolic and numeric notations and vice-versa.
per [OPTIONS] TARGET
- -S Treat notations as special notations.
- -v Print permissions verbosely.
- -n Print permissions in a numeric notation.
- -s Print permissions in a symbolic notation.
Options may be chained (e.g. -vns). Providing no options defaults to -vns. Providing only -S as an option defaults to -Svns.
TARGET may be:
- A symbolic notation (e.g. rwxr-xr-x)
- A numeric notation (e.g. 755)
- A file (e.g. /etc/passwd)
- A literal dash '-'
If TARGET is a literal dash '-', it will be replaced with a first line from stdin.
If -S option is used, per will accept and print special notations (e.g. rwsrwsrwT or 6775).
per -v /etc/passwd
per -Ss 6775
chmod `per -Sn file1` file2
Build deps: GNU make, gzip (for documentation)
To build and install the program with documentation run:
make
sudo make install
To build and install the program without documentation run:
make
sudo make install-bin
Per is also available in Arch User Repository. It will always be up to date with the latest release.
Building was tested and works on: Slackware, Artix, Arch, OpenBSD, NixOS and macOS.
Thanks for Legend for testing per on NixOS and for grylem for testing on macOS and for creating the manpage in mdoc format.
Bugs report to the github repo.
Made by Mariusz Jakoniuk (jarmuszz at tuta dot io).