1. Reset / .bashrc
The default .bashrc of the server is usually in the /etc/skel directory, so the empty ./bashrc file can be reset by the following statement:cp /etc/skel/.bashrc ~/
NOTE:
If you use windows to copy through mount and other methods, an error may occur:
-bash: /home/XXX/.bashrc: line 1: syntax error near unexpected token `$'in\r''So it is recommended to copy directly through the above command.
'bash: /home/XXX/.bashrc: line 1: `case $- in
The following are some personalized configurations, such as adding MATLAB, anaconda, etc. to the path.
2. Add anaconda initialization command
# added by Anaconda2 4.4.0 installer
export PATH="/home/XXX/anaconda3/bin:$PATH"
if [ $? -eq 0 ]; then
\eval "$__conda_setup"
else
if [ -f "/home/XXX/anaconda3/etc/profile.d/conda.sh" ]; then
. "/home/XXX/anaconda3/etc/profile.d/conda.sh"
CONDA_CHANGEPS1=false conda activate base
else
\export PATH="/home/XXX/anaconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda init <<<
3. Add custom shortcuts
For example:
# Shortcut for Anaconda Environment
sra(){
CONDA_ROOT="-/anaconda3"
env=$1
source activate $env
export LD_LIBRARY_PATH="$CONDA_ROOT/envs/$env/lib:$LD_LIBRARY_PATH"
}
alias srd='source deactivate'
# <<< conda shortcut <<<<<<<
没有评论:
发表评论