Open In App

chsh command in Linux with examples

Improve
Improve
Like Article
Like
Save
Share
Report

chsh command in Linux is used to change the user’s login shell(currently login shell). Shell is an interactive user interface with an operating system and can be considered an outer layer of the operating system. The bash shell is one of the most widely used login shells in Linux. This command allows the user to change the shell from the current shell. It can also give warning if the shell is not present in the /etc/shells file. The superuser can change the login shell for the existing accounts. 

Syntax:  

chsh [OPTIONS] [LOGIN]

Example 1: To show the list of all shells. You can use echo command along with ‘$SHELL’ to check the current shell 

Example 2: To change the current logging shell 

Options: 

  • -l: Used to specifies your login shell.
  • -u: Prints the list of shells.
  • -v: Shows information about version and exits.
  • -s: Used to set the shell as your login shell.

Last Updated : 26 Aug, 2021
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads