# Change Default Shell

Default shell can be changed by using `chsh` command.

## Usage

To see available shells -

```bash
cat /etc/shells
```

To see current shell -

```bash
echo $SHELL
```

To **finally** change shell -

```bash
chsh -s /path/to/shell
```

To see your new shell -

```bash
echo $SHELL
```

It should be changed now, in case `chsh` throws something like `you may not change the shell for ${USER}`, follow along!

## Using `usermod`

To see current shell -

```bash
grep ${USER} /etc/passwd
```

To change shell -

```bash
sudo usermod --shell /bin/bash nameofuser
```

Verify it by running -

```bash
grep ${USER} /etc/passwd
```

***Source:*** [***Unix - StackExchange***](https://unix.stackexchange.com/a/558971)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://til.devjugal.com/linux/change-default-shell.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
