Linux Commands Reference - Complete Linux Command Guide

Comprehensive Linux command reference with 150+ commands. Search, filter by category, and view detailed usage examples.

Share
Back to commands

su

Switch user

Syntax

su [OPTION]... [USERNAME]

Common Options

-Simulate full login
-cExecute specified command
-sSpecify shell
-lLogin shell simulation
-mPreserve environment

Common Examples

su -

Switch to root

su - username

Switch to specified user

su -c "whoami" root

Execute as root

su -s /bin/bash username

Specify shell

su - postgres

Switch to postgres user

Related Commands

Related Tools

More Code & Dev Tools