Last active
July 22, 2024 01:04
-
-
Save imgul/2fe4f43e4eb41109c915b1e8a50844c7 to your computer and use it in GitHub Desktop.
Awesome 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
# | |
# Python | |
# | |
alias python=python3.11 | |
# | |
# Laravel | |
# | |
alias pas='php artisan serve' | |
alias pat='php artisan tinker' | |
alias pa='php artisan' | |
alias pam="php artisan migrate" | |
alias par:l='php artisan route:list' | |
alias pam:f="artisan migrate:fresh" | |
alias pam:fs="artisan migrate:fresh --seed" | |
alias pam:r='php artisan migrate:refresh' | |
alias pam:rs='php artisan migrate:refresh --seed' | |
alias pac:c='php artisan cache:clear' | |
alias db-reset="php artisan migrate:reset && php artisan migrate --seed" | |
alias laravel-installer='composer create-project --prefer-dist laravel/laravel' | |
# Sail | |
alias sail='./vendor/bin/sail' | |
# | |
# PHP | |
# | |
alias p="phpunit" | |
alias pf="phpunit --filter" | |
alias pu="vendor/bin/phpunit" | |
alias puf="vendor/bin/phpunit --filter" | |
alias pug="vendor/bin/phpunit --group" | |
alias unit='php vendor/phpunit/phpunit/phpunit' | |
alias unitreport='php -d xdebug.profiler_enable=On vendor/phpunit/phpunit/phpunit --coverage-html=./public/report' | |
alias xampp='sudo service apache2 stop && sudo service mysql stop && cd /opt/lampp/ && sudo ./manager-linux-x64.run' | |
# | |
# Composer | |
# | |
alias cda="composer dump-autoload -o" | |
alias cu='composer update' | |
alias ci='composer install' | |
alias c='composer' | |
alias cr='composer require' | |
alias co='composer outdated --direct' | |
alias update-global-composer='cd ~/.composer && composer update' | |
alias composer-update-global='update-global-composer' | |
# | |
# Deployment | |
# Git | |
alias g='git' | |
alias gs='git status' | |
alias nah='git reset --hard && git clean -df' | |
alias showpublickey='cat ~/.ssh/id_ed25519.pub' | |
alias glg="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit" | |
alias glg2="git log --graph --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%an%C(reset)%C(bold yellow)%d%C(reset) %C(dim white)- %s%C(reset)' --all" | |
alias glo="git log --pretty=oneline" | |
alias gundo="git commit --amend" | |
alias gacp='function _gacp() { git add . && git commit -m "$1" && git push; }; _gacp' | |
# Server | |
alias stopserveram='sudo systemctl stop mysql && sudo systemctl stop apache2' | |
alias startserveram='sudo systemctl start mysql && sudo systemctl start apache2' | |
# Docker | |
alias d='docker' | |
alias dc='docker-compose' | |
alias dm='docker-machine' | |
alias k='kubectl' | |
# | |
# Shell | |
# | |
alias _='sudo' | |
alias copyssh="pbcopy < $HOME/.ssh/id_rsa.pub" | |
alias reloadcli="source $HOME/.zshrc" | |
alias pbcopy='xclip -selection clipboard' | |
alias pbpaste='xclip -selection clipboard -o' | |
# Network | |
alias publicip='dig +short myip.opendns.com @resolver1.opendns.com' | |
alias ip="curl icanhazip.com" | |
alias localip="ifconfig | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0.1'" | |
alias copy='rsync -avv --stats --human-readable --itemize-changes --progress --partial' | |
# Show file and folder permissions as octal | |
# Usage: `octal file.txt` or `octal my/path` | |
alias octal="stat -f '%A %a %N'" | |
# Mac conveniences for Linux | |
alias pbcopy='xclip -selection clipboard' | |
alias pbpaste='xclip -selection clipboard -o' | |
if type "xdg-open" &> /dev/null; then | |
alias open="xdg-open" | |
fi | |
# | |
# Directories | |
# | |
alias ll='ls -FGlAhp' | |
alias lh="ls -lh" | |
alias la='ls -lAh' | |
alias ..="cd ../" | |
alias ...="cd ../../" | |
alias ....="cd ../../../" | |
alias .....="cd ../../../../" | |
alias df="df -h" | |
alias diskusage="df" | |
alias fu="du -ch" | |
alias folderusage="fu" | |
alias tfu="du -sh" | |
alias totalfolderusage="tfu" | |
alias coding="cd /mnt/00B6823AB6822FE8/Coffee/Code/" | |
alias htdocs="cd /opt/lampp/htdocs" | |
# alias finder='open -a 'Finder' .' | |
mkcdir () | |
{ | |
mkdir -p -- "$1" && | |
cd -P -- "$1" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment