自己最常用的 bash alias(Mini alias)

有时候有新的 linux 到手时,需要添加一些常用的 alias,但不方便大范围定制
更新于: 2023-05-29 21:14:50

常用的列表

# Add by aric.zheng.   start ======
PS1="\[[\e[1;32m\]\u\[\e[m\]\[\e[1;36m\]@\[\e[m\]\[\e[1;35m\]\h\[\e[m\]:\w]\n\$ ";

# cd
alias ..='cd ..';
alias ...='cd ../..';
alias c-='cd -';

# list
alias l="ls -lhtr";
alias x="exit";
alias reload='source ~/.bashrc';

# git
alias gl='git pull';
alias gp='git push';
alias gs='git status ';

# others
alias sz='du -hs *';
alias szz='du -hks';
alias x='exit';

# python
alias py='python';

# pm2
alias pm2-logs='pm2 logs'
alias pm22='pm2 start ecosystem.config.js'
alias pm2d='pm2 delete'
alias pm2dd='pm2 delete all'
alias pm2l='pm2 list'
alias pm2p='pm2 stop'
alias pm2pp='pm2 stop all'
alias pm2r='pm2 restart'
alias pm2rr='pm2 restart all'
alias pm2rt='pm2 reset all'
alias pm2s='pm2 start'
alias pm2ss='pm2 start all'

# tails
alias tff='tail -f logs/spider.log';

# Add by aric.zheng.   end ======

同步 .netrc

同步到自己的用户目录下 ~,即可实现 git pull 直拉代码的

scp ~/.netrc target:/root

参考