Created
September 2, 2021 13:18
-
-
Save pida42/30e056dc9734ec338f47eb9c82c65d85 to your computer and use it in GitHub Desktop.
Most common Bash Aliases
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
# Docker, Docker Compose | |
alias docker-clear='docker rm -f $(docker ps -q -a); docker rmi -f $(docker images -q); docker system prune --all --force --volumes' | |
alias docker-down='docker-compose down' | |
alias docker-images='docker images --all' | |
alias docker-logs='docker-compose logs --tail=1000 -f -t' | |
alias docker-ps='docker ps -a' | |
alias docker-up='DATE_FROM=`date`; echo "BUILD START: $DATE_FROM" ; docker-compose up -d --build; DATE_TO=`date`; echo -e "BUILD START: $DATE_FROM\nBUILD END: $DATE_TO\n"' | |
alias docker-up-nohup='DATE_FROM=`date`; echo "BUILD START: $DATE_FROM" ; nohup docker-compose up -d --build $ && DATE_TO=`date`; echo -e "BUILD START: $DATE_FROM\nBUILD END: $DATE_TO\n"' | |
# Kubernetes | |
alias k8apply='kubectl apply -f' | |
alias k8dsc='kubectl describe' | |
alias k8logs='kubectl logs -f' | |
alias k8nodes='kubectl get nodes -o wide' | |
alias k8rem='kubectl delete -f' | |
alias k8show='kubectl get all,ing,pv,pvc --all-namespaces -o wide' | |
alias k8show-watch='watch -n 1 "kubectl get all,ing,pv,pvc --all-namespaces -o wide"' | |
# Netstat | |
alias netstat-ac='netstat -antu' | |
alias netstat-wc='netstat -antu | egrep ":(80|81|443|8080|8081|9081)" | grep -v LISTEN | awk "{print $5}" | cut -d: -f1 | sort | uniq -c | sort -rn' | |
# NMAP (https://bencane.com/2013/02/25/10-nmap-commands-every-sysadmin-should-know/) | |
alias nmap-discover-ips='nmap -sP' | |
alias nmap-open-ports='nmap' | |
alias nmap-os='nmap -O' | |
alias nmap-hostname='nmap -SL' | |
alias nmap-tcp-syc-udp-scan='nmap -sS -sU -PN' | |
alias nmap-tcp-syc-udp-scan-all-ports='nmap -sS -sU -PN -p 1-65535' | |
alias nmap-tcp-connect-scan='nmap -sT' | |
alias nmap-fast-hosts='nmap -T4 -A' | |
alias nmap-fast-scan='nmap -T4 -F' | |
# Other | |
alias watch-live='watch -t -n 0' | |
alias watch-one='watch -t -n 1' | |
alias watch-two='watch -t -n 2' | |
alias watch-five='watch -t -n 5' | |
alias watchl='watch -t -n 0' | |
alias watch1='watch -t -n 1' | |
alias watch2='watch -t -n 2' | |
alias watch5='watch -t -n 5' | |
# PhpStorm, PyCharm | |
alias phpstorm-repair-freeze='kill -9 `ps aux | grep storm | grep GNOME_SUDO_PASS | sed -E "s/^root\s+([0-9]+).*/\1/"`' | |
alias pycharm-repair-freeze='kill -9 `ps aux | grep pycharm | grep GNOME_SUDO_PASS | sed -E "s/^root\s+([0-9]+).*/\1/"`' | |
# Rsync | |
alias rsync-sync='/usr/bin/rsync --bwlimit=0.5m -r -t -v --progress --ignore-existing -c -l -z -i -s' | |
# SoundWireServer | |
alias SoundWireServer='SoundWireServer -p 59042 -verbose' | |
# VLC | |
alias vlc='killall /snap/vlc/1700/usr/bin/vlc && /snap/bin/vlc' | |
# Youtube-dl | |
alias youtube-dl-list='youtube-dl -f mp4 --yes-playlist -i ' | |
# WakaTime | |
alias wakatime='wakatime --entity=Terminal' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment