Skip to content

Instantly share code, notes, and snippets.

@pritdeveloper
Last active November 21, 2023 16:44
Show Gist options
  • Save pritdeveloper/7e703ce556680fb007b1d51090a6bfcf to your computer and use it in GitHub Desktop.
Save pritdeveloper/7e703ce556680fb007b1d51090a6bfcf to your computer and use it in GitHub Desktop.
aliases for linux
# common
alias ls='ls --color=auto -F'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
alias less="less -R "
alias ..="cd ../"
# file edit
alias ae='vi ~/.bash_aliases'
alias be='vi ~/.bashrc'
alias acon='sudo vi /etc/apache2/sites-enabled/000-default.conf'
alias gcon='vi ~/.gitconfig'
# git
alias gs='git status'
alias gc='git commit'
alias gd='git diff'
alias gds='git diff --staged'
alias gdc='git diff --color-words'
alias ga='git add'
alias gaa='git add -A'
alias gp='git pull'
alias gpu='git push'
alias gr='git reset'
alias grh='git reset --hard'
# ssh keys
alias ggk='ssh-keygen -b 4096 -t rsa -C ""'
alias gsk='cat ~/.ssh/id_rsa.pub'
# installs
alias ugi='sudo npm install -g ungit'
alias pmai='sudo apt install phpmyadmin -y'
# software use
alias ug='ungit --port 8081'
alias sr='sudo systemctl restart apache2 mysql'
alias sre='sudo systemctl reload apache2'
alias sst='sudo systemctl stop apache2 mysql'
alias ss='sudo systemctl status apache2 mysql'
alias srg='sudo systemctl restart apache2 mysql && ungit --port 8081'
alias cb='sudo certbot --apache -d'
alias cbm='sudo certbot certonly --manual --agree-tos --manual-public-ip-logging-ok --preferred-challenges dns -d'
alias cbc='sudo certbot certificates'
alias c='code . && exit'
alias s='subl . && exit'
alias tm='watch -n 1 sensors'
alias sp='watch -n 1 df -h'
alias fs='sp'
alias fd='sudo systemd-resolve --flush-caches && exit'
alias st='curl -s https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python -'
# helpers
alias clrd='rm -rf .[!.]* ..?* && rm -rf ./*'
# alias sf='sudo alsactl restore'
# alias rd='sudo pkill -9 X'
alias he='sudo vi /etc/hosts'
alias tb="nc termbin.com 9999"
alias es='sudo a2ensite'
alias ds='sudo a2dissite'
alias art='php artisan'
alias co='composer'
alias com='co'
alias comp='co'
alias sail='[ -f sail ] && sh sail || sh vendor/bin/sail'
# web installs
alias wpi='rm -rf .[!.]* ..?* && rm -rf ./* && wget --no-check-certificate -O wp.zip https://wordpress.org/latest.zip && unzip wp.zip && rm -rf wp.zip && mv wordpress/* ./ && rm -rf wordpress/'
alias wci='cd wp-content/plugins/ && rm -rf woocommerce/ && mkdir woocommerce && cd woocommerce && wget --no-check-certificate -O wc.zip https://downloads.wordpress.org/plugin/woocommerce.zip && unzip wc.zip && rm wc.zip && mv woocommerce/* ./ && rm -rf woocommerce/ && cd ../../../'
alias lri='rm -rf .[!.]* ..?* && rm -rf ./* && composer create-project --prefer-dist laravel/laravel ./'
alias cii='rm -rf .[!.]* ..?* && rm -rf ./* && composer create-project --prefer-dist codeigniter4/appstarter ./'
alias cki='rm -rf .[!.]* ..?* && rm -rf ./* && composer create-project --prefer-dist cakephp/app ./'
alias yii='rm -rf .[!.]* ..?* && rm -rf ./* && composer create-project --prefer-dist yiisoft/yii2-app-basic ./'
# navigation
alias ws='cd /var/www/html'
alias proj='ws'
alias html='ws'
alias www='ws'
alias an='ws && cd angular'
alias vh='cd /var/www/vhosts'
alias ww='vh'
alias plg='cd wp-content/plugins'
alias thm='cd wp-content/themes'
alias sa='cd /etc/apache2/sites-available'
alias se='cd /etc/apache2/sites-enabled'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment