Last active
August 2, 2025 01:17
-
-
Save jcanfield/3fdef375abae81626a401a44d66c173c to your computer and use it in GitHub Desktop.
Bash Aliases (.bash_aliases) for DEB based system
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Zsh Aliases Configuration | |
# by @jcanfield | |
# ============================================================================= | |
# SHORTENED COMMANDS | |
# ============================================================================= | |
alias ll='ls -l' | |
alias la='ls -a' | |
alias lc='ls -CF' | |
alias l='exa -l' # Removed $1 parameter for better zsh compatibility | |
alias grep='grep --color=auto' | |
alias ..='cd ..' | |
alias ...='cd ../..' | |
# ============================================================================= | |
# NAVIGATION ALIASES | |
# ============================================================================= | |
alias dl='cd ~/Downloads' | |
alias docs='cd ~/Documents' | |
alias desktop='cd ~/Desktop' | |
# ============================================================================= | |
# SYSTEM ALIASES | |
# ============================================================================= | |
alias update='sudo apt update && sudo apt upgrade' # Debian/Ubuntu | |
alias diskspace='df -h' | |
alias freemem='free -mhw' | |
alias searchmans='apropos -v' | |
# ============================================================================= | |
# GIT ALIASES | |
# ============================================================================= | |
alias gs='git status' | |
alias ga='git add' | |
alias gc='git commit -m' | |
alias gp='git push' | |
alias gl='git pull' | |
# ============================================================================= | |
# NETWORK MONITORING ALIASES | |
# ============================================================================= | |
# Comprehensive view with bmon (interactive, modern UI) | |
alias netmon='bmon -p eth0' | |
# Real-time bandwidth usage with iftop (requires sudo, shows connections) | |
# CAUTION: iftop can be resource intensive on very busy interfaces. | |
alias iftop_live='sudo iftop -i eth0 -P -n' | |
# Real-time bandwidth usage per process with nethogs (requires sudo) | |
# You might need to install nethogs if it's not already on your system | |
# alias nethogs_live='sudo nethogs eth0' | |
# Historical daily traffic with vnstat (shows daily, weekly, monthly stats) | |
# After initial install, vnstat needs to collect data for a bit. | |
alias netstats='vnstat -i eth0' | |
alias netstats_hourly='vnstat -i eth0 -h' # Hourly stats | |
alias netstats_daily='vnstat -i eth0 -d' # Daily stats | |
# Speedometer for simple ASCII bar graphs (visualize speed) | |
alias netmeter_dl='speedometer -r eth0' # Download speed | |
alias netmeter_ul='speedometer -t eth0' # Upload speed | |
alias netmeter_full='speedometer -r eth0 -t eth0' # Both DL/UL | |
# Bandwidth Meter NG (bwm-ng) for simple, configurable output | |
alias bwm_simple='bwm-ng -I eth0' | |
alias bwm_csv='bwm-ng -I eth0 -o csv -u bytes' # CSV output for logging/parsing | |
# CBM - Color Bandwidth Meter (simple, quick overview) | |
alias cbm_overview='cbm' # CBM typically monitors all interfaces | |
# iperf3 for network performance testing (client side, needs server) | |
# To test bandwidth to a remote iperf3 server (e.g., test.example.com) | |
# You would need to have an iperf3 server running on the remote end: iperf3 -s | |
alias iperf_test='iperf3 -c your_iperf3_server_ip -p 5201 -P 10' # Test with 10 parallel streams | |
alias iperf_server='iperf3 -s' # Run iperf3 as a server | |
# ============================================================================= | |
# CUSTOM ALIASES | |
# ============================================================================= | |
alias myip='curl ifconfig.me' | |
alias lsip='curl ipinfo.io 2>/dev/null | jq .' | |
alias weather='curl wttr.in/Dacono\&0' # Requires curl and internet connection | |
alias extendweather='curl wttr.in/Dacono\&5' | |
alias showmoon='curl wttr.in/Moon' | |
alias refresh='clear && source ~/.zshrc' # Changed from ~/.bash_profile to ~/.zshrc | |
alias networkload='nload -u m -t 2000 eth0' | |
# Alternative reload command | |
# alias reloadzsh='clear && source ~/.zshrc' | |
# Example of an alias that helps correct typos | |
alias ubdate='sudo apt update && sudo apt upgrade' # corrects a common typo | |
# ============================================================================= | |
# ADVANCED FUNCTIONS | |
# ============================================================================= | |
alias testspeed='testspeed_func' | |
testspeed_func() { | |
if [[ -z "$1" ]]; then | |
echo "Usage: testspeed <URL>" | |
return 1 | |
fi | |
curl -s -w 'Testing Website Response Time for :%{url_effective}\n\nLookup Time:\t\t%{time_namelookup}\nConnect Time:\t\t%{time_connect}\nPre-transfer Time:\t%{time_pretransfer}\nStart-transfer Time:\t%{time_starttransfer}\n\nTotal Time:\t\t%{time_total}\n' -o /dev/null "$1" | |
} | |
alias reddit='/home/$USER/.local/bin/tuir' | |
# alias weather='wego -location 80012 -u imperial' | |
# ============================================================================= | |
# DIRECTORY RELATED ALIASES | |
# ============================================================================= | |
# alias ls-size='du -ha --max-depth=1 | sort -n' | |
# alias ls-size2='du -ha --max-depth=2 | sort -n' | |
# alias ls-dirsize='ls_dirsize_func' | |
# ls_dirsize_func() { | |
# echo "Listing sizes for $1..." && du -h "$1" --max-depth=1 | sort -n | |
# } | |
# alias list-sizes='du -sch ./* | sort -n' | |
# ============================================================================= | |
# GIT RELATED ALIASES | |
# ============================================================================= | |
alias rm-dsstore-old="echo 'Removing DS_Store files..' && find . -type f \( -name '.DS_Store' -o -name '._.DS_Store' \) -delete -print 2>&1 | grep -v 'Permission denied'" | |
alias rm-dsstore-old2="echo 'Removing DS_Store files..' && find . -name '.DS_Store' -type f -delete" | |
alias git-rm-dsstore-old="echo 'Removing all .DS_Store files from directory and repository' && find . -name .DS_Store -print0 | xargs -0 git rm -f --ignore-unmatch" | |
# ============================================================================= | |
# MISCELLANEOUS | |
# ============================================================================= | |
alias screensaver='screensaver_func' | |
screensaver_func() { | |
/home/$USER/.apps/ascii-matrix/ascii-matrix -f "$1" | |
} | |
# ============================================================================= | |
# COMPARE FILES AND DIRECTORIES | |
# ============================================================================= | |
alias compare-dir='compare_dir_func' | |
compare_dir_func() { | |
if [[ $# -ne 2 ]]; then | |
echo "Usage: compare-dir <dir1> <dir2>" | |
return 1 | |
fi | |
du -sh "$1" "$2" && echo "Comparing $1 with $2..." | |
} | |
alias diff-dir='diff_dir_func' | |
diff_dir_func() { | |
if [[ $# -ne 2 ]]; then | |
echo "Usage: diff-dir <dir1> <dir2>" | |
return 1 | |
fi | |
diff -qr "$1" "$2" && echo "Diff with $1 and $2..." | |
} | |
# ============================================================================= | |
# SYSTEM UPDATES AND PACKAGE MANAGERS | |
# ============================================================================= | |
alias update-system-full='~/.bin/apt-upgrade-system' | |
# ============================================================================= | |
# ZSH FUNCTIONS | |
# ============================================================================= | |
# Create directory and cd into it (converted from bash function) | |
mkcd() { | |
if [[ -z "$1" ]]; then | |
echo "Usage: mkcd <directory_name>" | |
return 1 | |
fi | |
mkdir -p "$1" && cd "$1" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Example .bash_aliases file | |
# Shortened commands | |
alias ll='ls -l' | |
alias la='ls -a' | |
alias lc='ls -CF' | |
alias l="exa -l $1" | |
alias grep='grep --color=auto' | |
alias ..='cd ..' | |
alias ...='cd ../..' | |
# Navigation aliases | |
alias dl='cd ~/Downloads' | |
alias docs='cd ~/Documents' | |
alias desktop='cd ~/Desktop' | |
# System aliases | |
alias update='sudo apt update && sudo apt upgrade' # Debian/Ubuntu example | |
alias diskspace='df -h' | |
#alias freemem='free -m' | |
alias freemem='free -mhw' | |
alias searchmans='apropos -v' | |
# Git aliases | |
alias gs='git status' | |
alias ga='git add' | |
alias gc='git commit -m' | |
alias gp='git push' | |
alias gl='git pull' | |
# Network aliases | |
# --- Network Monitoring Aliases --- | |
# Test Proxy/VPNs | |
alias testsocks5='curl --proxy socks5://proxyuser:[email protected]:1080 https://ipinfo.io' | |
alias test-ss-local='curl --proxy socks5h://127.0.0.1:1080 https://ifconfig.me' | |
alias stop-ss-local='kill $(cat /tmp/ss-local.pid)' | |
alias chk-port='sudo ss -tulpn | grep ":$1"' | |
alias chk-port-more='sudo netstat -tulpn | grep ":$1"' | |
# Comprehensive view with bmon (interactive, modern UI) | |
alias netmon='bmon -p eth0' | |
# Real-time bandwidth usage with iftop (requires sudo, shows connections) | |
# CAUTION: iftop can be resource intensive on very busy interfaces. | |
alias iftop_live='sudo iftop -i eth0 -P -n' | |
# Real-time bandwidth usage per process with nethogs (requires sudo, excellent for finding culprits) | |
# You might need to install nethogs if it's not already on your system | |
# alias nethogs_live='sudo nethogs eth0' | |
# Historical daily traffic with vnstat (shows daily, weekly, monthly stats) | |
# After initial install, vnstat needs to collect data for a bit. | |
alias netstats='vnstat -i eth0' | |
alias netstats_hourly='vnstat -i eth0 -h' # Hourly stats | |
alias netstats_daily='vnstat -i eth0 -d' # Daily stats | |
# Speedometer for simple ASCII bar graphs (visualize speed) | |
alias netmeter_dl='speedometer -r eth0' # Download speed | |
alias netmeter_ul='speedometer -t eth0' # Upload speed | |
alias netmeter_full='speedometer -r eth0 -t eth0' # Both DL/UL | |
# Bandwidth Meter NG (bwm-ng) for simple, configurable output | |
alias bwm_simple='bwm-ng -I eth0' | |
alias bwm_csv='bwm-ng -I eth0 -o csv -u bytes' # CSV output for logging/parsing | |
# CBM - Color Bandwidth Meter (simple, quick overview) | |
alias cbm_overview='cbm' # CBM typically monitors all interfaces, eth0 specific might not be an option. | |
# iperf3 for network performance testing (client side, needs server) | |
# To test bandwidth to a remote iperf3 server (e.g., test.example.com) | |
# You would need to have an iperf3 server running on the remote end: iperf3 -s | |
alias iperf_test='iperf3 -c your_iperf3_server_ip -p 5201 -P 10' # Test with 10 parallel streams | |
alias iperf_server='iperf3 -s' # Run iperf3 as a server (useful on another VPS to test from this one) | |
alias tailfail2ban='sudo tail -f /var/log/fail2ban.log' | |
# Custom aliases | |
alias myip='curl ifconfig.me' | |
alias myip_ipv4='curl -4 icanhazip.com' | |
alias myip_ipv6='curl -6 icanhazip.com' | |
alias myip2='curl ifconfig.me' | |
alias myip3='curl api.ipify.org' | |
alias myip4='curl bot.whatismyipaddress.com' | |
alias myip5='curl ipinfo.io/ip' | |
alias myip6='curl ipecho.net/plain' | |
alias ipa='ip -br -c a' | |
alias lsip='curl ipinfo.io 2>/dev/null | jq '.'' | |
alias myweather='~/.bin/usweather.sh 40.08275 -104.92907' | |
alias weather='curl wttr.in/Dacono&0' # Requires curl and internet connection | |
alias extendweather='curl wttr.in/Dacono&5' | |
alias showmoon='curl wttr.in/Moon' | |
alias refresh='clear && source ~/.bash_profile' | |
alias networkload='nload -u m -t 2000 eth0' | |
alias checksum='sha256sum $1' | |
alias md5sum='md5sum $1' | |
alias check1sum='sha1sum $1' | |
alias check512sum='sha512sum $1' | |
alias genkey='openssl rand -base64 32' | |
# Or perhaps | |
# alias reloadbash='clear && source ~/.bashrc' | |
# Example of a function aliased | |
function mkcd() { | |
mkdir -p "$1" && cd "$1" | |
} | |
alias mkcd='mkcd' | |
# Example of an alias that helps correct typos | |
alias ubdate="sudo apt update && sudo apt upgrade" #corrects a common typ | |
## Advanced functions | |
alias testspeed="curl -s -w 'Testing Website Response Time for :%{url_effective}\n\nLookup Time:\t\t%{time_namelookup}\nConnect Time:\t\t%{time_connect}\nPre-transfer Time:\t%{time_pretransfer}\nStart-transfer Time:\t%{time_starttransfer}\n\nTotal Time:\t\t%{time_total}\n' -o /dev/null $1" | |
alias reddit="/home/$USER/.local/bin/tuir" | |
#alias weather="wego -location 80012 -u imperial" | |
## Directory related aliases | |
alias ls-size="du -ha --max-depth=1 | sort -n" | |
alias ls-size2="du -ha --max-depth=2 | sort -n" | |
alias ls-dirsize='echo "Listing sizes for $1..." && du -h "$1" --max-depth=1 | sort -n' | |
alias list-sizes="du -sch ./* | sort -n" | |
#alias l="exa -l" | |
## GIT related aliases | |
alias rm-dsstore-old="echo 'Removing DS_Store files..' && find . -type f \( -name '.DS_Store' -o -name '._.DS_Store' \) -delete -print 2>&1 | grep -v 'Permission denied'" | |
alias rm-dsstore-old2="echo 'Removing DS_Store files..' && find . -name '.DS_Store' -type f -delete" | |
alias git-rm-dsstore-old="echo 'Removing all .DS_Store files from directory and repository' && find . -name .DS_Store -print0 | xargs -0 git rm -f --ignore-unmatch" | |
## MISC | |
alias screensaver="/home/$USER/.apps/ascii-matrix/ascii-matrix -f $1" | |
## Project Related | |
##lish-creativeboulder-com='ssh -t [email protected] creativeboulder-com' | |
## Compare Files and Dirs | |
alias compare-dir='du -sh $1 $2 && echo "Comparing $1 with $2..."' | |
alias diff-dir='diff -qr $1 $2 && echo "Diff with $1 and $2..."' | |
## System Updates and Package Managers | |
alias update-system-full='sudo bash ~/.bin/apt-upgrade-system' | |
# ================================ | |
# SYSOPS ALIASES - NEW ADDITIONS | |
# ================================ | |
# === SYSTEM MONITORING === | |
alias cpu='top -o %CPU' | |
alias mem='top -o %MEM' | |
alias processes='ps aux' | |
alias listening='netstat -tuln' | |
alias ports='ss -tuln' | |
alias connections='ss -tuln' | |
alias load='uptime' | |
alias iostat='iostat -x 1' | |
alias vmstat='vmstat 1' | |
alias sysinfo='uname -a && lsb_release -a && python3 --version && pip --version && docker --version' | |
# === LOG MONITORING === | |
alias logs='journalctl -f' | |
alias syslog='sudo tail -f /var/log/syslog' | |
alias authlog='sudo tail -f /var/log/auth.log' | |
alias kernlog='sudo tail -f /var/log/kern.log' | |
alias apachelog='sudo tail -f /var/log/apache2/error.log' | |
alias nginxlog='sudo tail -f /var/log/nginx/error.log' | |
alias maillog='sudo tail -f /var/log/mail.log' | |
# === SERVICE MANAGEMENT === | |
alias services='systemctl list-units --type=service' | |
alias failed='systemctl list-units --failed' | |
alias restart='sudo systemctl restart' | |
alias status='sudo systemctl status' | |
alias enable='sudo systemctl enable' | |
alias disable='sudo systemctl disable' | |
alias start='sudo systemctl start' | |
alias stop='sudo systemctl stop' | |
alias reload='sudo systemctl reload' | |
# === DISK AND FILESYSTEM === | |
alias disk='df -h' | |
alias diskusage='du -sh * | sort -hr' | |
alias bigfiles='find . -type f -size +100M -exec ls -lh {} \; | awk "{print \$9 \": \" \$5}"' | |
alias inodes='df -i' | |
alias mounts='mount | column -t' | |
alias lsblk='lsblk -f' | |
# === PROCESS MANAGEMENT === | |
alias psmem='ps auxf | sort -nr -k 4' | |
alias pscpu='ps auxf | sort -nr -k 3' | |
alias killall='sudo killall' | |
alias zombie='ps aux | awk "{if(\$8~\"Z\") print \$2}" | xargs -r sudo kill -9' | |
# === NETWORK TROUBLESHOOTING === | |
alias netstat='netstat -tuln' | |
alias ss='ss -tuln' | |
alias lsof='sudo lsof -i' | |
alias tcpdump='sudo tcpdump -i eth0' | |
alias ping='ping -c 4' | |
alias mtr='mtr --report-cycles 10' | |
alias traceroute='traceroute' | |
alias nslookup='nslookup' | |
alias dig='dig' | |
# === FILE OPERATIONS === | |
alias backup='rsync -avz --progress' | |
alias perms='stat -c "%A %a %n"' | |
alias findlarge='find / -size +1G -type f 2>/dev/null' | |
alias findold='find / -mtime +365 -type f 2>/dev/null' | |
alias cleanup='sudo apt autoremove && sudo apt autoclean' | |
# === SECURITY === | |
alias lastlogin='last -10' | |
alias failed_logins='sudo grep "Failed password" /var/log/auth.log | tail -10' | |
alias open_ports='sudo netstat -tuln | grep LISTEN' | |
alias firewall='sudo ufw status verbose' | |
alias crontab_list='crontab -l' | |
alias who_online='who' | |
# === QUICK SYSTEM CHECKS === | |
alias health='df -h && free -h && uptime' | |
alias quickcheck='systemctl --failed && df -h | grep -E "(100%|9[0-9]%)" && free | grep -E "Mem|Swap"' | |
alias temp='sensors 2>/dev/null || echo "lm-sensors not installed"' | |
# === USER AND PERMISSION MANAGEMENT === | |
alias users='cut -d: -f1 /etc/passwd' | |
alias groups='cut -d: -f1 /etc/group' | |
alias sudoers='sudo cat /etc/sudoers' | |
alias passwd_info='sudo chage -l' | |
# === PACKAGE MANAGEMENT === | |
alias installed='dpkg -l' | |
alias search='apt search' | |
alias install='sudo apt install' | |
alias remove='sudo apt remove' | |
alias purge='sudo apt purge' | |
alias autoremove='sudo apt autoremove' | |
alias policy='apt policy' | |
# === DATABASE QUICK ACCESS (if applicable) === | |
alias mysql_status='sudo systemctl status mysql' | |
alias postgres_status='sudo systemctl status postgresql' | |
alias redis_status='sudo systemctl status redis' | |
# === DOCKER (if applicable) === | |
alias dps='docker ps' | |
alias dpsa='docker ps -a' | |
alias dimages='docker images' | |
alias dstats='docker stats' | |
alias dclean='docker system prune -f' | |
# === HELPFUL FUNCTIONS === | |
function findprocess() { | |
ps aux | grep -i "$1" | grep -v grep | |
} | |
alias fp='findprocess' | |
function port_process() { | |
sudo lsof -i :$1 | |
} | |
alias pp='port_process' | |
function extract_logs() { | |
sudo journalctl -u "$1" --since "1 hour ago" | |
} | |
alias logs_service='extract_logs' | |
# Install all required tools command (run this once) | |
alias install_sysops_tools='sudo apt update && sudo apt install -y htop iotop iftop nethogs vnstat bmon speedometer bwm-ng nload iperf3 tcpdump mtr-tiny lsof tree ncdu dstat sysstat lm-sensors curl wget jq git exa fail2ban ufw rsync' | |
alias install_sysmon_tools='sudo apt install atop btop nmon smem ripgrep' | |
# === MISC PROJECT ALIASES === | |
alias w1='cd ~/Workspace && echo "Switched to Workspace..."' | |
alias w2='cd ~/Workspace/creativeboulder-com && echo "Switched to creativeboulder.com Project folder..."' | |
alias w3='cd ~/Workspace/fine-ideas-com_latest && echo "Switched to fine-ideas.com Project folder..."' | |
#alias vm-schatzbox='gcloud compute ssh --zone "us-central1-b" "vm-schatzbox" --project "theschatzbox"' | |
#alias gcloud-vm-schatazbox='gcloud compute ssh cloud-creativeboulder-com' | |
#alias azure-vm-schatzbox='ssh [email protected]' | |
alias gcloud-vm-schatzbox='gcloud compute ssh --project=theschatzbox --zone=us-west1-c cloud-creativeboulder-com' | |
alias azure-vm-schatzbox='az ssh vm --local-user $USER --resource-type Microsoft.Compute/virtualMachines --resource-group vm-schatzbox --name vm-schatzbox' | |
alias aws-vm-schatzbox='ssh -i .ssh/$USER@primary_aws.pem [email protected]' | |
# === MISC ALIASES === | |
alias start-ss-local='/usr/bin/ss-local -c /home/$USER/.config/shadowsocks/client.json -f /tmp/sslocal.pid -v' | |
# === EXTRA SYSTEM TOOLS === | |
alias apt_full_upgrade='sudo sh ~/.bin/apt-upgrade-system' | |
alias vid_apps_info='echo -e "Installation complete! Key tools installed:\n- ffmpeg/ffprobe: Video processing and metadata extraction\n- mediainfo: Media file analysis\n- exiftool: EXIF/metadata extraction\n- imagemagick: Image processing\n- sox: Audio analysis\n- hashdeep: File hashing\n- sleuthkit: File system analysis\n- volatility: Memory analysis\n- opencv: Computer vision\n- Python hashing libraries: dhash, imagehash, ssim-pil"' | |
source ~/.bash_aliases.perftest |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment