# The use of -r in id command.

## dE_logics

With the -r switch id should print the real UID/GID, but running id -ru or -rg with su -c prints the EUID/EGID.

So, what the use of this switch?

----------

## papahuhn

su sets both effective and real UID/GID via setuid(), as it is a suid root binary (man 2 setuid).

----------

## dE_logics

Oh, ok,. I didn't know anything like that happened.

----------

