Skip to content

Instantly share code, notes, and snippets.

@itskenny0
Created January 9, 2018 12:02
Show Gist options
  • Save itskenny0/de4a1015e16aa47d2e87bea012cf6616 to your computer and use it in GitHub Desktop.
Save itskenny0/de4a1015e16aa47d2e87bea012cf6616 to your computer and use it in GitHub Desktop.
# shorthands
alias sl="ls --color"
alias txfv="tar xfv"
alias hgr="history | grep "
alias apti="apt install "
alias apts="apt search "
alias lsb="lsb_release -a"
alias ls="ls --color "
alias ll='ls -l --color'
alias k="tree"
alias mount='mount | column -t'
alias fastping='ping -s.1'
alias salt-call='salt-call -l info'
alias highstate='salt-call state.highstate'
alias sls='salt-call state.sls '
alias lsofi='lsof -i | grep LISTEN'
alias greppkg='dpkg --get-selections | grep '
alias lindirstat='du -ach | sort -h'
alias findps="ps aux | grep -v grep | grep -i -e VSZ -e"
alias df="pydf"
alias pubip="curl -s https://ip.kenny.cat"
# supervisor
alias caddyre="supervisorctl restart caddy"
alias svupd="supervisorctl update"
alias svstatus="supervisorctl status"
alias svstart="supervisorctl start "
alias svstop="supervisorctl stop "
alias svrestart="supervisorctl restart "
# logs
alias tailsyslog='tail -f /var/log/syslog'
alias tail100='tail -100'
# quick navigation
alias ..="cd .."
alias ...='cd ../../../'
alias ....='cd ../../../../'
alias .....='cd ../../../../'
alias .4='cd ../../../../'
alias .5='cd ../../../../..'
alias varlog="cd /var/log/"
# create folder and cd into it
mkcd() {
mkdir -p $1
cd $1
}
# count files in current folder
countfiles() {
N="$(ls $1 | wc -l)";
echo "$N files in $1";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment