Linux Shell change

Source: Internet
Author: User

Digress: Recently, due to an attempt, we installed and set the highly recommended zsh to replace the default Bash. After a while, we found that there were a lot of things, but the same problem was also exposed, for example, there is a problem with executing commands in the zsh background, so I decided to change to bash. I forgot to record the previous method so as not to change it next time, you do not need to refer to others' blogs.

First, check the available shells in our system.

Androidyue @ Ubuntu :~ /Adb_grep $ CAT/etc/shells #/etc/shells: valid login shells/bin/sh/bin/dash/bin/bash/bin/rbash/usr/bin/tmux/bin/CSH/bin/tcsh/bin/zsh/usr/ bin/zsh/usr/local/bin/zsh

Then, we can also retrieve our current Shell

Androidyue @ Ubuntu :~ /Adb_grep $ echo $ shell/bin/zsh

Finally, the key to the problem is to execute CHSH (which should be change shell). This Command requires the root permission and prompts you to enter the password. Then, enter the available target shell in the input focus.

Androidyue @ Ubuntu :~ /Adb_grep $ chshpassword: Changing the login shell for androidyueenter the new value, or press enter for the defaultlogin shell [/bin/bash]:

Finally, if you want to take effect, You need to log out and log on (for example, the prompt for the first command is what login shells means, so ...)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.