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:

  • history   history command example Linux bash history keeps every command a user typed in the command line terminal into a file named .bash_history. Here is an example of Linux history command with no option running i… Read More
  • xargs   xargs command examples Copy all images to external hard-drive # ls *.jpg | xargs -n1 -i cp {} /external-hard-drive/directory Search all jpg images in the system and archive it. # find / -name *.jpg -type… Read More
  • hostname   hostname Print or set system name SYNTAX $ hostname With no arguments, `hostname' prints the name of the current host system. With one argument, it sets the current host name to the specified str… Read More
  • jobs   jobs command example Print currently running jobs and their status. Syntax jobs [OPTIONS] [PID] Options: -c --command Print the command name for each process in jobs -g --group Only… Read More
  • yum yum command examples To install apache using yum. $ yum install httpd To upgrade apache using yum. $ yum update httpd To uninstall/remove apache using yum. $ yum remove httpd … Read More

0 comments:

Post a Comment