The su command is most commonly used to switch to another user. You will then be able to run commands as if you were that user and in their environment. In this article, we will show you the basic usage of the Linux su command.
su anotherUser
This will allow you to keep your own defined environment variables
su -m anotherUser
su -s /bin/bash anotherUser
Master your Linux knowledge. Experiment with our List of Top Linux commands for Beginners or Experts on your own Linux Dedicated server, SSD VPS machine or an SSH Shared Hosting account. Get your shared hosting account with a great discount of 40% OFF the regular price now!