Zsh is a Unix shell that can be used both as an interactive login shell and as a command interpreter for shell scripting. It incorporates features from other shells like Bash, ksh, and tcsh, offering enhancements such as programmable command-line completion, extended file globbing, improved variable and array handling, and customizable prompts.
# **.zshrc File:**
The .zshrc file is a configuration file for Zsh, located in the user’s home directory (~/.zshrc). It allows users to customize the behavior and appearance of their interactive shell sessions by setting environment variables, defining aliases, configuring prompt appearance, and enabling plugins or themes. This file is executed every time a new interactive Zsh session is started, applying the specified configurations.
For example, to add a directory to the PATH environment variable and set a custom prompt, you might include the following in your .zshrc file:
```
# Add ~/bin to the PATH
export PATH="$HOME/bin:$PATH"
# Set a custom prompt
PROMPT='%n@%m %1~ %# '
```
After modifying the .zshrc file, you can apply the changes by sourcing it:
```
source ~/.zshrc
```
This command reloads the configuration without the need to restart the terminal. For a visual introduction to Zsh, you might find this beginner’s guide helpful: