You could do this with an alias or with a simple shell function.
With an alias:
alias changeto='su -'
With a shell function:
changeto () {
su - "$@"
}
Both of these would behave the same when used on the command line.
You would put either of these (but not both) in whatever place that you usually put alias definitions, most likely into ~/.bashrc
or ~/.bash_aliases
if you are using bash
as your interactive shell. The alias or shell function will be available in the next shell that you start (for example if you open a new terminal).
If using the alias, then the shell would simply replace the word changeto
with su -
when you use that command. Any further arguments that you use (a username, for example) will be tagged on to the end of that.
If using the shell function, the shell would call su -
followed by whatever other arguments you pass to the function. In this case, the effect would be the same as with the alias.
changeto
shorter thansu -
? And what back\end? did you miss out something important?