存档 | linux alias 配置,自定义常用命令的快捷形式


(这些配置是从组里同期那边 copy + 同学帮忙写的,仅存档自用;致谢同期和同学)


编辑 .bashrc ,添加

# alias
alias sb='source ~/.bashrc'
alias vbrc='vim ~/.bashrc'
alias cx='chmod +x'

alias tb='tensorboard --logdir . --window_title $(pwd)'
alias tbb='tensorboard --logdir . --window_title $(pwd) &'
alias tbp='tensorboard --logdir . --window_title $(pwd) --port'

function tbbp(){
    tensorboard --logdir . --window_title $(pwd) --port $1 &
}

alias pdg='ps -def | head -n 1; ps -def | grep'
alias pag='ps -aux | head -n 1; ps -aux | grep'

alias tat='tmux attach -t'
alias tl='tmux ls'
alias tn='tmux new-session -s'
alias tk='tmux kill-session -t'

alias du1='du -ch -d 1'      # 当前目录磁盘占用
alias dun='du -ch -d'        # 当前目录磁盘占用(递归n层)
alias du1g='du -ch -d 1 2>&1 | grep -v "cannot read directory"'

alias ns='nvidia-smi'
alias gf='gpustat -f'
alias cca='conda activate'
alias ccd='conda deactivate'
alias ccl='conda env list'
alias pl='pip list'

alias clash="/home/yyq-shixi2/clash/clash > /home/yyq-shixi2/clash/clash.log 2>&1 & export http_proxy=http://127.0.0.1:7890; export https_proxy=http://127.0.0.1:7890"
alias unclash="unset http_proxy; unset https_proxy; pkill -9 clash"

然后 source ~/.bashrc



posted @ 2024-07-31 17:35  MoonOut  阅读(2)  评论(0编辑  收藏  举报