|
Many users of unix systems immediately start a bash shell after logging in. The bash shell has the well known advantage of easy command line editing and easy repeating previously executed command lines.
Unfortunately the bash shell is not the standard shell for many unix users. Fortunately it is easy to change your shell to the bash shell. Just follow these steps:
- Check your current shell, see the environment variable SHELL. Write this shell down in case you ever need to revert the shell change.
- Check the path to bash with which bash. Usually the output is /bin/bash.
- Log out and then log in as root and execute the following command: usermod -s /bin/bash username. Substitute your username for the username argument and make sure the path to bash is correct.
It may be that the editing of the command line appears to be broken in your bash shell. In that case your bash shell might operate in vi mode. Even the most fanatic vi evangelist does not like this. Therefore the emacs mode is the default mode for the bash shell. Change your bash shell to emacs mode by removing any lines as below in your login scripts:
set -o vi
Alternatively you could set the bash shell to emacs mode with the following shell command:
set -o emacs
Finally a number of useful key bindings in the bash shell operating in the emacs mode:
| ctrl-a | Go to the beginning of the command line |
| ctrl-e | Go to the end of the command line |
| alt-b | Go back one word |
| alt-f | Go forward one word, |
| |
| ctrl-d | Delete current character |
| ctrl-w | Backward kill word |
| alt-d | Forward kill word |
| ctrl-k | Forward kill rest of the line |
| ctrl-x backspace | Backward kill rest of the line |
| |
| ctrl-y | Yank previous kill |
| ctrl-_ | Undo |
After changing to bash shell on a couple of machines we could not use sftp any more on one of the machines. It turned out that when using sftp as service of the ssh daemon, login scripts like .profile and .bashrc are run. One of these scripts contained output and that broke sftp file transfers. We had a couple of options:
- Changing back to ksh, these login scripts did not contain any echo statements,
- commenting out all echo statements for the user we changed the shell to bash,
- using the scp protocol instead of sftp
- changing the ssh daemon such that sftp did not use a login shell
We implemented the second option. With the third option some people needed to install a different remote file transfer client. Implementing the fourth option affected other unix users apart from the user for which the shell was changed to bash. If such a unix user changes the umask in a login scripts then the fourth option might affect the permissions of any files uploaded with sftp.
|