In Redhat linux. from my user if I issue command
sudo su -> changes to root
su tomcat –> changes to tomcat user
Why does tailing the commands in single line doesn't work?
sudo su; su tomcat –> stil in root. Doesn't switch to tomcat
commandlinuxsusudo
In Redhat linux. from my user if I issue command
sudo su -> changes to root
su tomcat –> changes to tomcat user
Why does tailing the commands in single line doesn't work?
sudo su; su tomcat –> stil in root. Doesn't switch to tomcat
Best Answer
The commands
are two commands. The shell will run the first and when it completes it will run the second. Note that the shell does not pass the second command as an argument to the first command.
When you exit the first command it will run the second
You can use sudo to transition to the tomcat user directly
or use
-s
to get a shell e.g.