Linux alias Guide - ryzendew/Linux-Tips-and-Tricks GitHub Wiki
Linux alias Guide
Complete beginner-friendly guide to alias on Linux, covering Arch Linux, CachyOS, and other distributions including creating aliases, command shortcuts, and shell customization.
Table of Contents
Understanding alias
What is alias?
alias creates command shortcuts.
Uses:
- Shortcuts: Create command shortcuts
- Customize commands: Modify command behavior
- Save typing: Reduce typing
- Shell customization: Customize shell
Why it matters:
- Productivity: Save time typing
- Customization: Personalize commands
- Convenience: Make commands easier
alias Basics
Create Alias
Basic usage:
# Create alias
alias ll='ls -alF'
# Use alias
ll
List Aliases
Show aliases:
# List all aliases
alias
# Or specific
alias ll
Creating Aliases
Common Aliases
Useful aliases:
# Long listing
alias ll='ls -alF'
# Color output
alias ls='ls --color=auto'
# Safety
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
Complex Aliases
Advanced aliases:
# With arguments
alias grep='grep --color=auto'
# Multiple commands
alias update='sudo pacman -Syu'
Persistent Aliases
Shell Configuration
Add to config:
# Edit shell config
vim ~/.bashrc
# Or
vim ~/.zshrc
Add Aliases
In config file:
# Add to ~/.bashrc
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
Reload Config
Apply changes:
# Reload config
source ~/.bashrc
# Or
. ~/.bashrc
Troubleshooting
Alias Not Working
Check config:
# Verify alias exists
alias ll
# Check if in config
grep alias ~/.bashrc
# Reload config
source ~/.bashrc
Summary
This guide covered alias usage, command shortcuts, and shell customization for Arch Linux, CachyOS, and other distributions.
Next Steps
- Shell Configuration - Shell setup
- Bash Scripting Guide - Scripting
- alias Documentation:
man alias
This guide covers Arch Linux, CachyOS, and other Linux distributions. For distribution-specific details, refer to your distribution's documentation.