Saturday, April 26, 2014

su

  •  su command examples


Switch to a different user account using su command. Super user can switch to any other user without entering their password.
$ su - USERNAME


Execute a single command from a different account name. In the following example, john can execute the ls command as raj username. Once the command is executed, it will come back to john’s account.
[linux@care-server]$ su - raj -c 'ls' 
[linux@care-server]$


Login to a specified user account, and execute the specified shell instead of the default shell.
$ su -s 'SHELLNAME' USERNAME

Related Posts:

  • kill kill command examples Use kill command to terminate a process. First get the process id using ps -ef command, then use kill -9 to kill the running Linux process as shown below. You can also use killall, pkill, xkill … Read More
  • mysql  mysql  command example mysql is probably the most widely used open source database on Linux. Even if you don’t run a mysql database on your server, you might end-up using the mysql command ( client ) to connect … Read More
  • less    less command examples less is very efficient while viewing huge log files, as it doesn’t need to load the full file while opening. $ less huge-log-file.log One you open a file using less command, follow… Read More
  • man   man command examples Display the man page of a specific command.    $ man crontab When a man page for a command is located under more than one section, you can view the man page for that command from… Read More
  • mkdir   mkdir command examples Following example creates a directory called temp under your home directory. $ mkdir ~/temp Create nested directories using one mkdir command. If any of these directories exist already… Read More

0 comments:

Post a Comment