➣ Reading Time: 8 minutes

前言

alias 就是 縮寫的意思,
透過設定好的縮寫,可以大幅加快我們使用 terminal 開發的效率

個人的 alias (ubuntu)

編輯 bashrc, zshrc, config.fish (依照個人使用的 shell 而定)

vim ~/.bashrc
vim ~/.zshrc
vim ~/.config/fish/config.fish

alias 內容 (ubuntu)

# -------------------- personal setting -------------------- #
## Colorize the ls output ##
alias ls='ls --color=auto'
## Use a long listing format ##
alias ll='ls -la'
## Show hidden files ##
alias l.='ls -d .* --color=auto'

## Colorize the grep command output for ease of use (good for log files)##
alias grep='grep --color=auto'

# install  colordiff package :)
alias diff='colordiff'

# handy short cuts #
alias h='history'
alias j='jobs -l'

alias path='echo -e ${PATH//:/\\n}'
alias now='date +"%T"'
alias nowtime=now
alias nowdate='date +"%d-%m-%Y"'

# do not delete / or prompt if deleting more than 3 files at a time #
alias rm='rm -I --preserve-root'

# -------------------- howard personal setting -------------------- #
alias apt-get='sudo apt-get -y'
alias ..='cd ..'
alias open='xdg-open' # ubunut open folder
alias gohoward='cd ~/Desktop/'
alias gosomepc='sshpass -p <password> ssh ubuntu@<ip>'

預設自動啟動 anaconda

適用於修改 zshrc, bashrc

# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="('/Users/howardweng/opt/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [? -eq 0 ]; then
    eval "__conda_setup"
else
    if [ -f "/Users/howardweng/opt/anaconda3/etc/profile.d/conda.sh" ]; then
        . "/Users/howardweng/opt/anaconda3/etc/profile.d/conda.sh"
    else
        export PATH="/Users/howardweng/opt/anaconda3/bin:PATH"
    fi
fi
unset __conda_setup
# <<< conda initialize <<<