In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly shows you "how to use the chsh command in Linux". The content is simple and clear. I hope it can help you solve your doubts. Let the editor lead you to study and learn how to use the chsh command in Linux.
The chsh command is used to replace the shell used when logging in to the system. If you do not specify any parameters and user names, chsh is set as a reply.
Chsh is used to replace the shell used when logging in to the system
Syntax chsh (options) (parameters) options-s or-- shell: change the system preset shell environment. ;-l or-- list-shells: make a list of shell currently available on the system;-u or-- help: online help;-v or-version: display version information. Parameter user name: the user who wants to change the default shell.
There are two ways to check which shell is installed on the system by using an instance:
The first kind:
[rocrocket@localhost] $chsh-l / bin/sh / bin/bash / sbin/nologin / bin/zsh II:
[rocrocket@localhost ~] $cat / etc/shells / bin/sh / bin/bash / sbin/nologin / bin/zsh actually chsh-l is also here to view this file.
View the shell currently in use:
[rocrocket@localhost ~] $echo $SHELL / bin/bash Note SHELL must be uppercase. As you can see, the shell currently in use is / bin/bash
Change my shell to zsh:
[rocrocket@localhost] $chsh-s / bin/zsh Changing shell for rocrocket. Password: Shell changed. [rocrocket@localhost ~] $you can modify the login shell by using chsh plus the option-s! You will find that you still output as / bin/bash after executing echo $SHELL, because you need to restart your shell to fully fall into the arms of zsh. Chsh-s actually modifies the line in the / etc/passwd file that corresponds to your user name. Now let's take a look:
[rocrocket@localhost ~] $cat / etc/passwd | grep ^ rocrocket rocrocket:x:500:500:rocrocket,China:/rocrocket/PSB/home:/bin/zsh you can see that the last part of the output has become / bin/zsh. The next time you restart, linux will read this command to start shell!
Modify shell back to / bin/bash:
[rocrocket@localhost] $chsh-s / bin/bash Changing shell for rocrocket. Password: Shell changed. The above is all the contents of the article "how to use chsh commands in Linux". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.