Skip to content

Instantly share code, notes, and snippets.

@elhenro elhenro/.bash_aliases
Last active Jun 18, 2019

Embed
What would you like to do?
# henro's bash aliases
## general
alias ls='ls --color=auto'
alias l='ls -lhtr --color=auto'
# bash history
alias searchBashHistory='cat ~/.bash_history | fzf';
# clipboard
alias clippy='xclip -r -selection clipboard';
# monitors
alias listopenports='netstat -lntu';
alias monitorDiskUsage='iostat -x 1';
alias monitorNetworkConnections='sudo iftop -i enp1s0';
alias monitorNetworkTraffic='slurm -i enp1s0';
# backup function b
b(){
for f in "$@"
do cp -a "$f" "$f".$(date +%Y%m%d%H%M)
done
}
# npm
alias ni='npm install'
alias nid='npm install --save-dev'
alias nig='npm install --global'
alias nt='npm test'
alias nit='npm install && npm test'
alias nk='npm link'
alias nr='npm run'
alias ns='npm start'
alias nf='npm cache clean && rm -rf node_modules && npm install'
alias nlg='npm list --global --depth=0'
alias followGitlabRunnerLogs='sudo journalctl --follow -u gitlab-runner';
alias followFirstDockerContaienr='sudo sh ~/tools/followFirstDocker.sh';
alias ffd='followFirstDockerContaienr';
alias emptyTrash='sh ~/tools/emptyTrash.sh';
alias visualizeGitBranches='git log --graph --decorate --oneline';
alias visualizeGitBranchesFull='git log --graph --full-history --all --pretty=format:"%h%x09%d%x20%s"';
source ~/.bash_secret_aliases
alias colorToClipboard='colorpicker --short --one-shot | clippy';
### git shortcuts
alias s="git status -s"
alias lo='git log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=short'
alias lg='git log'
alias a="git add"
alias ap='git add -p'
alias c='git commit --verbose'
alias ca='git commit -a --verbose'
alias cm='git commit -m'
alias cam='git commit -a -m'
#alias m='git commit --ammend --verbose'
alias d='git difftool'
alias di='git diff'
alias ds='git diff --stat'
alias dc='git diff --cached'
alias co='git checkout'
alias cob='git checkout -b'
alias br='git branch'
alias bri='visualizeGitBranches'
alias briv='visualizeGitBranchesFull'
alias bv='git branch -va'
### end of git shortcuts
alias ping='prettyping --nolegend'
alias preview="fzf --preview 'bat --color \"always\" {}'"
alias p='preview'
export FZF_DEFAULT_OPTS="--bind='ctrl-o:execute(code {})+abort'"
alias du="ncdu --color dark -rr -x --exclude .git --exclude node_modules"
alias help='tldr'
alias netmon='slurm -i enp1s0';
alias searchPacmanPackages="pacman -Slq | fzf -m --preview 'pacman -Si {1}' | xargs -r sudo pacman -S"
alias alljs="find . -type d -name \"node_modules\" -prune -o \( -type f -name \"*.js\" -o -type f -name \"*.json\" \) -print"
alias vimjs="alljs | xargs vim"
alias listBashAliases='bat ~/.bash_aliases'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.