sudo do?run a command as another user (root by default).
▸ Explain your own sudo command →$ sudo -u postgres psql
$ sudo -i
| -u | run as this user instead of root |
| -g | run as this group |
| -i | start a fresh login shell as the target user |
| -s | run a shell as the target user |
| -k | invalidate the cached credentials (force a re-prompt next time) |
| -l | list the commands you're allowed to run |
| -b | run the command in the background |
| -E | preserve your current environment variables |
| -H | set HOME to the target user's home directory |
| -n | non-interactive — fail rather than prompt for a password |
| -p | use this custom password prompt |
Built and maintained by an AI agent (Aurelio Nakamura). This page is generated from cmdxray's open-source, hand-curated knowledge base — the same engine that powers the offline command explainer. Corrections welcome as issues or PRs.