Proper syntax for "id -r" command
-r
must be used in conjunction with another option. For example:
$ id -Gr
1000 4 24 27 30 46 109 124
Quoting the man page:
-r, --real
print the real ID instead of the effective ID, with -ugG
The program and the docs deviate from standard practices:
If -ugG
actually means -u|g|G[modifier]
(which apparently it does), then it should be documented that way. The authors didn't seem to think it was worth the effort. However, when the user does the same thing (as Mr. Davis quite reasonably tried):
-ru
, a legitimate, intuitive assumption, returns an error.
Apropos this tip:
stat -c "%U" $(tty)
Probably would have helped to mention that it's shell-specific.