grep alias .zshrc
unalias -a
alias history='history -i'
alias zsh_upgrade='cd ~/.oh-my-zsh/ && git stash && cd - && omz update && cd $ZSH_CUSTOM/plugins/zsh-syntax-highlighting && git pull && cd $ZSH_CUSTOM/plugins/zsh-autosuggestions && git pull && cd -'
#+++++ setting & alias +++++
export EDITOR=vim
alias vi=vim
alias sc='export LANG=zh_CN.UTF-8 LC_CTYPE=zh_CN.UTF-8 LC_MESSAGES=zh_CN.UTF-8'
alias tc='export LANG=zh_TW.UTF-8 LC_CTYPE=zh_TW.UTF-8 LC_MESSAGES=zh_TW.UTF-8'
alias en='export LANG=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8'
if [[ $(command -v pacman) ]]; then
alias pacman='sudo pacman'
alias orphan='sudo pacman -Rscn $(pacman -Qtdq)'
alias pkgclean='sudo paccache -rk 2 2>/dev/null'
alias up='yay || pkgclean -rk 2 && orphan'
#makepkg aur
alias aurinfo='updpkgsums && makepkg --printsrcinfo > .SRCINFO ; git status'
elif [[ $(command -v apt) ]]; then
alias apt='sudo apt'
alias orphan='sudo apt purge $(deborphan)'
alias up='sudo apt update && sudo apt dist-upgrade'
alias pkgclean='sudo apt autoremove && sudo apt autoclean'
elif [[ $(command -v yum) ]]; then
alias yum='sudo yum'
# alias orphan=''
alias up='sudo yum update'
alias pkgclean='sudo yum clean all'
fi
#---system commands alias for different os---
alias trim='sudo fstrim -v /home && sudo fstrim -v /'
alias logclean='sudo journalctl --vacuum-time=1weeks'
alias systemctl='sudo systemctl'
alias rb='systemctl reboot'
alias rm='mv -f --target-directory=$HOME/.local/share/Trash/files/'
alias trashclean='\rm -rf $HOME/.local/share/Trash/files/*'
alias tmquickly='sudo sysctl debug.lowpri_throttle_enabled=0'
alias tmlistsnap='tmutil listlocalsnapshotdates'
alias tmlistbackups='tmutil listbackups'
alias tmrmsnap=' tmutil deletelocalsnapshots '
alias tmrmbackup='sudo tmutil delete '
alias ll='ls -lh'
alias la='ls -lah'
alias cp='cp -i'
alias grep='grep --color'
alias tree='tree -C -L 1 --dirsfirst'
alias iconvgbk='iconv -f GBK -t UTF-8'
alias convmvgbk='convmv -f GBK -T UTF-8 --notest --nosmart'
alias ping='ping -c 4'
alias px='proxychains4'
alias 'nmap-ports'="sudo nmap -sS ${gateway%.*}.0/24"
alias 'nmap-hosts'="nmap -sP ${gateway%.*}.0/24"
alias 'nmap-os'="sudo nmap -O ${gateway%.*}.0/24"
alias dockerstart='sudo systemctl start docker && docker ps -a'
alias dockerclean="docker images|grep none|awk '{print \$3}'|xargs docker rmi"
alias virtstart='sudo modprobe virtio && sudo systemctl start libvirtd ebtables dnsmasq'
#alias vimpluginstall="curl -fLo ~/.vim/autoload/plug.vim --create-dirs
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim"
alias rec='asciinema rec -i 5 terminal-`date +%Y%m%d-%H%M%S`' #record
alias play='asciinema play' #play record file
alias npmlistg='npm -g list --depth=0'
alias npmupg='npm -g upgrade'
alias npmtaobao='npm config set registry
https://registry.npm.taobao.org'
alias python=python3
alias pip=pip3
alias pipoutdated='pip list --outdated'
alias pipupgrade='pip install --upgrade $(echo $(pip list --outdate|sed -n "3,$ p"|cut -d " " -f 1))'
alias condaclean='conda clean -ady'
alias sshfscvml='sshfs vps:/root /tmp/vps -o follow_symlinks && open /tmp/cvml'
alias fzfbat="fzf --preview 'bat {}'"