Linux Terminal Guide: Advanced Shell Skills for Professionals
Advanced Linux terminal techniques including shell customization, multiplexing, productivity tools, and scripting best practices.
Choosing Your Shell
Bash is the default on most Linux distributions — reliable, widely available, and well-documented. Configuration file: ~/.bashrc.
Zsh offers significant improvements including better autocompletion, theme support, and plugin management. It is the default shell in Kali Linux and macOS. Configuration file: ~/.zshrc.
Fish provides user-friendly features out of the box including syntax highlighting and autosuggestions.
Shell Customization with Oh My Zsh
Oh My Zsh is a framework for managing Zsh configuration:
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
Popular themes: agnoster (clean informative prompt), powerlevel10k (highly customizable, fast), robbyrussell (simple default).
Essential plugins: git (aliases and completions), docker, sudo (double-tap Esc to add sudo), web-search, colorize.
Powerlevel10k
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/powerlevel10k
echo 'source ~/powerlevel10k/powerlevel10k.zsh-theme' >>~/.zshrc
Run p10k configure for interactive setup.
Terminal Multiplexing with tmux
tmux allows running multiple terminal sessions in one window:
tmux new -s mysession # Create new session
tmux attach -t mysession # Attach to session
tmux ls # List sessions
Pane management: Ctrl+B % (vertical split), Ctrl+B " (horizontal split), Ctrl+B arrow (navigate), Ctrl+B x (close pane).
Window management: Ctrl+B c (create), Ctrl+B n/p (next/previous), Ctrl+B w (list).
Advanced Text Processing
jq processes JSON data: curl api.example.com/data | jq '.[].name'
yq is the YAML equivalent for parsing YAML configuration files.
ripgrep (rg) is a faster alternative to grep: rg pattern /path/to/search
bat displays files with syntax highlighting and line numbers: bat filename.py
Network Tools Deep Dive
Netcat (nc)
nc -zv 192.168.1.1 1-1000 # Port scanning
nc -v 192.168.1.1 80 # Banner grabbing
nc -l -p 4444 > received_file # File receiver
Socat
More powerful than netcat:
socat TCP-LISTEN:8080,fork TCP:192.168.1.1:80 # Port forwarding
Productivity Enhancements
fzf provides interactive fuzzy search: vim **<TAB>
htop is an enhanced process viewer with tree view and mouse support.
bat replaces cat with syntax highlighting.
Shell Scripting Best Practices
#!/bin/bash
set -euo pipefail
IFS=#039;\n\t'
Debug with bash -x script.sh or set -x within scripts.
Mastering the terminal is an ongoing journey. Start by customizing your shell environment, then gradually incorporate advanced tools and automation into your workflow.