Zsh is a powerful shell with advanced features like syntax highlighting, autosuggestions, and themes.
- Install Zsh and its addons:
yum install zsh*
- Verify the version and location:
zsh --version
which zsh
- Use a
.zshrc
file to customize Zsh. For example, copy the.zshrc
file from Kali Linux to make Zsh look similar.
- Find the location of Zsh:
which zsh
- Set it as the default shell:
chsh -s $(which zsh)
This changes your default shell in the /etc/passwd
file, which stores user account information, including the default shell.
- Themes: Customize the prompt and appearance.
- Plugins: Install plugins like oh-my-zsh for additional features.
- Auto-completion: Provides advanced completion for commands.
A shell can be made more powerful and user-friendly by adding plugins and utilities that enhance its capabilities. These improvements can include:
- Auto-completion for commands and file paths.
- Colorized output for better readability.
- Aliases to shorten or simplify frequently used commands.
- Enhanced customization through configuration files.
Plugins or add-ons are additional features or tools that enhance the functionality of a shell. For example:
- Bash plugins can add auto-completion, colored prompts, and more.
- Tools like grc add color to the output of commands, improving visual clarity.
- Command:
yum install bash*
The *
wildcard ensures that all packages related to "bash" are installed.
- Command:
yum search bash
This lists all available packages related to "bash."
- Auto-completion plugin:
yum install bash-completion.noarch
After installation, typing part of a command and pressing Tab
completes the command automatically.
- Color prompt plugin:
yum install bash-color-prompt.noarch
This changes the terminal prompt to a colored format for better visibility.
- After installing a plugin, exit the session and re-login to see the changes.
- For example, try using
Tab
completion after installingbash-completion.
The grc
tool is used to add color to the output of certain commands.
- If
wget
is not installed, install it first:
yum install wget
- Download the
grc
package from GitHub:
wget https://github.com/garabik/grc/archive/refs/tags/v1.13.tar.gz
- Extract the tar file:
tar -xvf v1.13.tar.gz
- Move the extracted folder (
grc-1.13
) to/opt/
:
mv grc-1.13 /opt/
/opt/
is used for installing optional or third-party software that isn't part of the default system.
- Navigate to the directory and run the installer script:
cd /opt/grc-1.13
./install.sh
- Try using
grc
with supported commands:
grc ping 8.8.8.8
grc ifconfig
- For unsupported commands,
grc
won’t add color. You can check the supported commands in thegrc.sh
file on GitHub.
- The file contains lines like this:
alias blkid='colourify blkid'
The colourify
function is a wrapper that applies grc
automatically to the specified command (e.g., blkid
). By setting these aliases, you don’t need to prepend grc
manually.
- Place aliases in the
.bashrc
file:
alias ping='grc ping'
- Reload the
.bashrc
file without restarting:
source /root/.bashrc
- Copy the
grc.sh
script to/etc/
:
cp /opt/grc-1.13/grc.sh /etc/
- Add this to
.bashrc
:
GRC_ALIASES=true
[[ -s "/etc/profile.d/grc.sh" ]] && source /etc/grc.sh
Feature/Command | Explanation |
---|---|
sh , bash |
Temporarily start a new shell session. |
$SHELL |
Shows the default shell for the user. |
.bashrc |
Configuration file for bash at login. |
grc |
Adds color to command output. |
zsh |
A feature-rich shell with plugins and themes. |
chsh -s $(which zsh) |
Permanently change the default shell. |