Skip to content

Instantly share code, notes, and snippets.

@ijleesw
Created July 9, 2019 04:39
Show Gist options
  • Save ijleesw/a54054bf24e10ea4e058ae2b31053a81 to your computer and use it in GitHub Desktop.
Save ijleesw/a54054bf24e10ea4e058ae2b31053a81 to your computer and use it in GitHub Desktop.
.bashrc setting for ubuntu 14.04
alias v='vim '
alias sudo='sudo '
alias p='python3.5 '
alias gsq='gnome-session-quit'
alias :q='exit'
psg() {
ps -ef | grep $1
}
pspid() {
ps -ef | grep $1 | grep -v grep | awk '{printf "%s\t", $2; for (i=8; i<=NF; i++) printf " %s", $i; printf "\n"}' | grep $1
}
lsg() {
if (( $# == 1 ))
then
ls | grep $1
elif (( $# == 2))
then
ls $1 | grep $2
else
echo 'lsg: should have 1 or 2 arguments.'
fi
}
cla() {
clang++ -std=c++11 -g a.cpp && ./a.out
}
cl() {
clang++ -std=c++11 $* && ./a.out
}
k9() {
kill -9 $*
}
kall() {
ps aux | grep $1 | grep -v grep | awk '{print $2}' | xargs kill -9
}
gdif () {
if [ "$#" -ne 1 ]; then
printf "Usage: gdif <commit_hash>\n"
return 1
fi
git diff $1~ $1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment