Forrest logo
back to the chsh tool

chsh:tldr:dbb9f

chsh: Set a login [s]hell for a specific user.
$ chsh -s ${path-to-shell} ${username}
try on your machine

The command chsh -s ${path-to-shell} ${username} is used to change the default shell for a specific user in a Unix-like operating system. Here is a breakdown of the command:

  • chsh: This is the command itself, which stands for "change shell".
  • -s: This option is used to specify the new shell.
  • ${path-to-shell}: This represents the path to the desired shell executable. For example, if you want to change the shell to bash, the path could be /bin/bash.
  • ${username}: This is the username of the user for whom you want to change the shell.

By executing this command with the appropriate values filled in, you will change the default shell for the specified user to the specified shell. This means that whenever the user logs in or opens a terminal session, the specified shell will be used instead of the previous default shell.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the chsh tool