Linux Shell Configuration - ryzendew/Linux-Tips-and-Tricks GitHub Wiki
Linux Shell Configuration Guide
Complete beginner-friendly guide to shell configuration on Linux, covering Arch Linux, CachyOS, and other distributions including Bash, Zsh, Fish, and shell customization.
Table of Contents
Bash Configuration
Install Bash
Bash is default:
# Check version
bash --version
# Usually pre-installed
Configure Bash
Edit bashrc:
# Edit bashrc
vim ~/.bashrc
# Or bash_profile
vim ~/.bash_profile
Common settings:
# Aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
# Prompt
PS1='[\u@\h \W]\$ '
# History
HISTSIZE=1000
HISTFILESIZE=2000
Zsh Configuration
Install Zsh
Install Zsh:
# Arch/CachyOS
sudo pacman -S zsh
# Debian/Ubuntu
sudo apt install zsh
# Fedora
sudo dnf install zsh
Change Shell
Change to Zsh:
# Change shell
chsh -s /bin/zsh
# Log out and back in
oh-my-zsh
Install oh-my-zsh:
# Install oh-my-zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
Configure Zsh
Edit zshrc:
# Edit zshrc
vim ~/.zshrc
# Reload
source ~/.zshrc
Fish Configuration
Install Fish
Install Fish:
# Arch/CachyOS
sudo pacman -S fish
# Debian/Ubuntu
sudo apt install fish
# Fedora
sudo dnf install fish
Change Shell
Change to Fish:
# Change shell
chsh -s /usr/bin/fish
# Log out and back in
Configure Fish
Edit config:
# Edit config
vim ~/.config/fish/config.fish
Shell Customization
Prompt Customization
Bash prompt:
# Edit bashrc
vim ~/.bashrc
# Custom prompt
PS1='[\u@\h \W]\$ '
Aliases
Create aliases:
# Add to shell config
alias ll='ls -alF'
alias la='ls -A'
alias ..='cd ..'
Troubleshooting
Shell Not Changing
Check shell:
# Check current shell
echo $SHELL
# Check available shells
cat /etc/shells
Config Not Loading
Check config:
# Bash
cat ~/.bashrc
# Zsh
cat ~/.zshrc
# Reload
source ~/.bashrc
Summary
This guide covered shell configuration for Arch Linux, CachyOS, and other distributions, including Bash, Zsh, Fish, and customization.
Next Steps
- Terminal Emulators - Terminal setup
- System Configuration - System setup
- ArchWiki Shell: https://wiki.archlinux.org/title/Command-line_shell
This guide covers Arch Linux, CachyOS, and other Linux distributions. For distribution-specific details, refer to your distribution's documentation.