The Wayback Machine - https://web.archive.org/web/20240217171907/https://www.geeksforgeeks.org/chsh-command-in-linux-with-examples/
Open In App
Related Articles

chsh command in Linux with examples

Improve
Improve
Improve
Like Article
Like
Save Article
Save
Report issue
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.

Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now!


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