OS Manuals

/usr/bin/su

A memory safe implementation of sudo and su.

From sudo-rs 0.2.15-r3 (os), captured 2026-11-05 by running su --help (exit 0). permalink

Usage: su [options] [-] [<user> [<argument>...]]

Change the effective user ID and group ID to that of <user>.
A mere - implies -l.  If <user> is not given, root is assumed.

Options:
-m, -p, --preserve-environment      do not reset environment variables
-w, --whitelist-environment <list>  don't reset specified variables

-g, --group <group>             specify the primary group
-G, --supp-group <group>        specify a supplemental group

-, -l, --login                  make the shell a login shell
-c, --command <command>         pass a single command to the shell with -c
-s, --shell <shell>             run <shell> if /etc/shells allows it
-P, --pty                       ignored (a pseudo-terminal is always used when possible)

-h, --help                      display this help
-V, --version                   display version
Options (10)
OptionDescriptionSource
-m, -p, --preserve-environmentdo not reset environment variableshelp
-w, --whitelist-environment listdon't reset specified variableshelp
-g, --group groupspecify the primary grouphelp
-G, --supp-group groupspecify a supplemental grouphelp
-l, --loginmake the shell a login shellhelp
-c, --command commandpass a single command to the shell with -chelp
-s, --shell shellrun <shell> if /etc/shells allows ithelp
-P, --ptyignored (a pseudo-terminal is always used when possible)help
-h, --helpdisplay this helphelp
-V, --versiondisplay versionhelp

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.