Skip to content

Instantly share code, notes, and snippets.

@chrishantha
Last active November 20, 2020 00:52
Show Gist options
  • Save chrishantha/933b7051f4de93b0501f to your computer and use it in GitHub Desktop.
Save chrishantha/933b7051f4de93b0501f to your computer and use it in GitHub Desktop.
My Bash Aliases
alias mcid="mvn clean install -Dmaven.javadoc.skip=true -Dfindbugs.skip=true -Dspotbugs.skip=true -Dcheckstyle.skip=true -Dpmd.skip=true -Dcobertura.skip=true -Dmaven.test.skip=true -DskipTests"
alias mcit="mvn clean install -Dmaven.javadoc.skip=true -Dfindbugs.skip=true -Dspotbugs.skip=true -Dcheckstyle.skip=true -Dpmd.skip=true -Dcobertura.skip=true"
alias mci="mvn clean install"
# go back x directories
b() {
str=""
count=0
while [ "$count" -lt "$1" ]; do
str=$str"../"
let count=count+1
done
cd $str
}
# make and change into directory
function mcd() {
mkdir -p "$1" && cd "$1"
}
alias freq='cut -f1 -d" " ~/.bash_history | sort | uniq -c | sort -nr | head -n 30'
alias ..='cd ..'
alias ...='cd ../../'
alias ....='cd ../../../'
alias .....='cd ../../../../'
alias ......='cd ../../../../../'
alias c='clear'
alias gl="git log --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
title() {
ORIG=$PS1
TITLE="\e]2;$1\a"
PS1=${ORIG}${TITLE}
}
addtimestamp() {
while IFS= read -r line; do
echo "$(date +%s) $line"
done
}
open_explorer() {
local path="${1}"
[[ -z "${path}" ]] && path="${PWD}"
explorer.exe "$(wslpath -w "${path}")"
return 0
}
alias open="open_explorer"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment