Last active
August 29, 2015 14:23
-
-
Save shoaibi/4b831fb00330a1c515ba to your computer and use it in GitHub Desktop.
My bash aliases
This file contains 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
~/.bash/aliases/apt | |
################## | |
# APT | |
################## | |
#alias apt-fast='~/scripts/apt-fast.sh' | |
#alias sagif='sudo apt-fast install -f' | |
#alias sagi='sudo apt-fast install' | |
#alias sagur='sudo apt-fast upgrade' | |
#alias sacs='sudo apt-cache search' | |
#alias sagu='sudo apt-fast update' | |
#alias ag-auto-upgrade-system='sudo apt-fast update && sudo apt-fast dist-upgrade -y --force-yes && sudo apt-fast clean' | |
#alias ag-upgrade-system='sudo apt-fast update && sudo apt-fast dist-upgrade && sudo apt-fast clean' | |
#alias heavy-pkgs="dpkg-query --show --showformat='${Package;-50}\t${Installed-Size}\n' | sort -k 2 -n | grep -v deinstall | awk '{printf "%.3f MB \t %s\n", $2/(1024), $1}' | tail -n 25" | |
#alias remove-old-kernels="sudo apt-fast purge \$(dpkg -l | grep '^ii' | awk '{print \$2}' | egrep -e '^linux-(image|headers)-[0-9]' | egrep -v `uname -r | cut -d '-' -f1,2`)" | |
#alias remove-old-kernels="sudo apt-fast purge $(dpkg -l | grep '^ii' | awk '{print $2}' | egrep -e '^linux-(image|headers)-[0-9]' | egrep -v `uname -r | cut -d '-' -f1,2`)" | |
~/.bash/aliases/composer | |
################## | |
# Composer Aliases | |
################## | |
alias c='composer' | |
alias ci='c install' | |
alias cu='c update' | |
alias cg='c global' | |
alias cgsu='cg self-update' | |
alias cgi='cg install' | |
alias cgu='cg update' | |
alias cgs='cg show' | |
alias cgsi='cgs -i' | |
alias cgdao='cg dump-autoload -o' | |
alias cdao='c dump-autoload -o' | |
alias csc="composer validate" | |
alias cscc="find . -type f -name 'composer.json' -exec composer validate {} \; | grep -v ' is valid '" | |
~/.bash/aliases/dpkg | |
################## | |
# DPKG Aliases | |
################## | |
#alias sdi='sudo dpkg -i' | |
#alias isinst='dpkg -l | egrep -i' | |
#alias dpkgs="dpkg-query -S" | |
#alias dpkgl="dpkg-query -L" | |
#alias dpkgif="dpkg -i --force-overwrite" | |
~/.bash/aliases/edit | |
####################### | |
# File editing aliases | |
####################### | |
alias e='vim' | |
alias eui='leafpad' | |
alias vi='vim' | |
alias v='vi' | |
alias sv='sudo vim' | |
alias st='subl3' | |
~/.bash/aliases/file_or_dir_manipulation | |
######################################### | |
# File and directory manipulation aliases | |
######################################### | |
alias rm='rm -I --preserve-root' | |
alias cp='cp -i' | |
alias mv='mv -i' | |
alias grep='grep --color=auto' | |
alias g='grep' | |
alias eg='egrep' | |
alias chown='chown --preserve-root' | |
alias chmod='chmod --preserve-root' | |
alias chgrp='chgrp --preserve-root' | |
alias rm-dangling-ln="find . -type l -! -exec test -e {} \; -print" | |
~/.bash/aliases/git | |
################# | |
# Git Aliases | |
################# | |
#alias ga='git add' | |
#alias gaa='ga .' | |
#alias gst='git status' | |
#alias gco='git checkout' | |
#alias gc='git commit' | |
#alias gcm='c -m' | |
#alias gcam='gcm -a' | |
#alias gcaam='gaa; gcaam' | |
#alias gcl='git clone' | |
#alias gclr='gcl --recursive' | |
alias git-submodules-update='git submodule update --init --recursive' | |
alias git-clone-with-submodules='git clone --recursive' | |
alias git-clean-flush='git reset --hard HEAD; git clean -fxd' | |
alias git-is-tracked='git ls-files file_name --error-unmatch' | |
~/.bash/aliases/hg | |
######################### | |
# Mercurial | |
######################### | |
alias hg-count-heads="hg heads --template '{branch}\n' | sort | uniq -c | sort -n" | |
~/.bash/aliases/ls | |
###################### | |
# ls aliases | |
###################### | |
alias ls='ls --group-directories-first --time-style=+"%d/%m/%Y %H:%M" --color -h' | |
#alias ll='ls -lh' | |
#alias la='ls -a' | |
#alias lal='ls -alh' | |
#alias lll='ls -alhF' | |
#alias l='ls -CF' | |
~/.bash/aliases/misc | |
################# | |
# Misc Aliases | |
################# | |
alias cd..='cd ..' | |
alias ..='cd ..;' | |
alias .2='cd ../../' | |
alias .3='cd ../../../' | |
alias .4='cd ../../../../' | |
alias .5='cd ../../../../../' | |
alias .6='cd ../../../../../../' | |
alias sbc='source ~/.bashrc' | |
alias sha1='openssl sha1' | |
#alias less='most' | |
#alias less='less -X -M' | |
#alias xdg-open="BROWSER=$BROWSER xdg-open" | |
alias open='xdg-open' | |
alias ]='open' | |
alias mkdir='mkdir -p' | |
alias df='df -x tmpfs -x devtmpfs -x overlay' | |
alias su='su -' | |
#alias ka='killall' | |
#alias ka9='killall -9' | |
#alias k9='kill -9' | |
#alias find-empty-files='find . -type f -size 0 -print' | |
alias generate-server-name="figlet -f slant -t " | |
alias spwgen='pwgen -s -y -1 25 5' | |
alias free-ram='free -m;sudo su -c "sync;sync;sync;sync;sync; echo 3 > /proc/sys/vm/drop_caches" ; free -m' | |
alias calym='cal -y -m' | |
alias du='du --summarize --human-readable * | sort --human-numeric-sort' | |
alias purge-qb-files='find . -type f -name "*\!qB" -delete' | |
alias diff='colordiff' | |
alias top='htop' | |
alias mount='mount |column -t' | |
alias h='history' | |
alias j='jobs -l' | |
alias path='echo -e ${PATH//:/\\n}' | |
alias now='date +"%T"' | |
alias nowtime=now | |
alias nowdate='date +"%d-%m-%Y"' | |
alias psmem10='ps auxf | sort -nr -k 4 | head -10' | |
#alias startx='startx &> ~/.xlog' | |
#alias sudb='sudo updatedb' | |
#alias smdb='sudo mandb' | |
#alias hmu='who | wc -l && echo users are logged in currently.'; | |
~/.bash/aliases/network | |
############################## | |
# Network Related | |
############################# | |
alias ping='ping -n -i 0.2' | |
alias 1ping='ping -c1' | |
#alias am-live='ping -c1 8.8.8.8' | |
#alias traceroute='traceroute -n -w 3 -q 1 -N 32' | |
alias rsync='rsync --progress -cazhSP' | |
#alias dl='aria2c' | |
alias nh='sudo nethogs wlp13s0' | |
#alias ifconfig='ifconfig -a' | |
alias netstat='sudo netstat -pleatun' | |
alias header='curl -I' | |
#alias mcdstats='/usr/bin/memcached-tool 10.10.27.11:11211 stats' | |
#alias mcdshow='/usr/bin/memcached-tool 10.10.27.11:11211 display' | |
~/.bash/aliases/pacman | |
################# | |
# Pacman | |
################# | |
# colored output | |
#alias pacman='PACMAN=/usr/bin/pacman; [ -f /usr/bin/pacman-color ] && PACMAN=/usr/bin/pacman-color; $PACMAN $@' | |
#alias pacman='powerpill' | |
alias pac-unlock='sudo rm /var/lib/pacman/db.lck' # Delete the lock file /var/lib/pacman/db.lck | |
alias pac-lock='sudo touch /var/lib/pacman/db.lck' # Create the lock file /var/lib/pacman/db.lck | |
alias pac-cache-unlock='sudo rm /var/cache/pacman/pkg/cache.lck' # Delete the lock file /var/cache/pacman/pkg/cache.lck created by pacman downloader | |
alias pac-mirror-regen='sudo pacman-mirrors -g' # Regenerate mirrorlist | |
alias pac-mirror-refresh='sudo pacman -Syy' # Force refresh of all package lists after updating /etc/pacman.d/mirrorlist | |
alias pac-upgrade='sudo pacman -Syyu' # Synchronize with repositories before upgrading packages that are out of date on the local system. | |
alias pac-install='sudo pacman -S' # Install specific package(s) from the repositories | |
alias pac-install-file='sudo pacman -U' # Install specific package not from the repositories but from a file | |
alias pac-remove='sudo pacman -R' # Remove the specified package(s), retaining its configuration(s) and required dependencies | |
alias pac-purge='sudo pacman -Rns' # Remove the specified package(s), its configuration(s) and unneeded dependencies | |
alias pac-show='pacman -Si' # Display information about a given package in the repositories | |
alias pac-search='pacman -Ss' # Search for package(s) in the repositories | |
alias pac-show-local='pacman -Qi' # Display information about a given package in the local database | |
alias pac-search-local='pacman -Qs' # Search for package(s) in the local database | |
#alias pac-autoremove='sudo su -c 'pacman -Rns $(pacman -Qdtq)'' # Remove all packages that are not longer needed | |
alias pac-list-dangling='pacman -Qdtq' # List packages that aren't needed | |
alias pac-clean='sudo pkgcacheclean -v 2' # Remove any files that are no longer needed but keep 2 version | |
alias pac-download='pacman -Sw' # Download specified package(s) as .tar.xz ball | |
# Additional pacman alias examples | |
#alias pac-install-dependency='sudo pacman -S --asdeps' # Install given package(s) as dependencies of another package | |
alias pac-show-file-package='sudo pacman -Qo' | |
alias pac-show-package-files='sudo pacman -Qpl' | |
alias pac-show-installed='sudo pacman -Q' | |
alias pac-show-installed-info='sudo pacman -Qi' | |
alias pac-show-info='sudo pacman -Si' | |
alias pac-show-huge='sudo pacgraph -c | sort --human-numeric-sort' | |
alias pac-dump-packages="sudo pacman -Qqe | grep -vx '$(pacman -Qqm)'" | |
alias pac-locate-update-files="sudo updatedb && sudo locate '.pac' | grep -v '\.pack'" | |
alias pac-clean-db-sig="sudo rm /var/lib/pacman/sync/*db.sig*" | |
~/.bash/aliases/phpmyadmin | |
############################### | |
# PHPMYADMIN | |
################################ | |
alias pma-clone='git clone --depth=1 --single-branch --branch=STABLE git://github.com/phpmyadmin/phpmyadmin.git' | |
alias pma-reinstall='cd ~/public_html; rm -rf phpmyadmin-git/; pma-clone phpmyadmin-git && cd pma && ln -s ~/public_html/phpmyadmin.config.inc.php config.inc.php && restart-web-related-servers && cd - &> /dev/null' | |
~/.bash/aliases/systemctl | |
################################## | |
# Systemctl Aliases | |
################################## | |
alias sc='systemctl' | |
alias ssc='sudo systemctl' | |
alias ssc-enable='ssc enable' | |
alias ssc-disable='ssc disable' | |
alias ssc-start='ssc start' | |
alias ssc-status='ssc status' | |
alias ssc-stop='ssc stop' | |
alias ssc-restart='ssc restart' | |
alias ssc-reload='ssc daemon-reload' | |
alias ssc-show-units='ssc list-unit-files --type=service' | |
alias ssc-timers='ssc list-timers' | |
~/.bash/aliases/todo | |
#################################### | |
# TODO | |
#################################### | |
alias todo-list-critical='grep -inr crit * | grep -i todo' | |
alias todo-list-high='grep -inr hig * | grep -i todo' | |
alias todo-list-medium='grep -inr medi * | grep -i todo' | |
alias todo-list-low='grep -inr low * | grep -i todo' | |
alias todo-list-nopriority='grep -inr todo *' | |
~/.bash/aliases/vagrant | |
#################################### | |
# VAGRANT | |
#################################### | |
alias vg='vagrant' | |
alias vh='vg halt' | |
alias vu='vg up' | |
alias vr='vg reload' | |
alias vhu='vh ; vu' | |
alias vs='vg ssh' | |
alias vsp='vs -p' | |
~/.bash/aliases/web | |
################################### | |
# Web | |
################################### | |
alias php-sc="php -l" | |
alias php-sc-current="find . -type f -name '*\.php' -exec php -l {} \; | grep -v 'No syntax'" | |
alias php-suspicious-files="find . -type f -name '*.php' -exec grep --with-filename 'eval(\|exec(\|base64_decode(' {} \;" | |
alias php-use-statement="find . -type f -name '*.php' -exec grep --with-filename -c '^use ' {} \; | sort -t ':' -k 2 -n -r" | |
alias php-find-abstract="find . -type f -name '*.php' -exec grep --with-filename -c '^abstract class ' {} \; | grep ':[^0]'" | |
alias php-multi-class-files="find . -type f -name '*.php' -exec grep --with-filename -c '^class ' {} \; | grep ':[2-99]' | sort -t ':' -k 2 -n -r" | |
~/.bash/aliases/yaourt | |
################################## | |
# Yaourt | |
################################## | |
alias yaourt-upgrade='yaourt -Syua' # upgrade all yaourt packages | |
alias yaourt-dump-package='pacman -Qqm' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment