无Root配置zsh和Oh-my-zsh

无root,系统里没有zsh的时候,无法用chsh切换zsh

zsh

安装zsh

1
2
3
4
5
6
git clone https://github.com/zsh-users/zsh.git
cd zsh
./Util/preconfig
./configure --prefix=/ifswh1/BC_COM_P2/F13FTSNCKF1344/SHEtbyR/software/zsh/zsh
make
make install

.bash_profile 加一行

1
exec /ifswh1/BC_COM_P2/F13FTSNCKF1344/SHEtbyR/software/zsh/zsh/bin/zsh

oh-my-zsh

安装oh-my-zsh

1
2
3
4
5
git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
# 备份原来的.zshrc
cp ~/.zshrc ~/.zshrc.orig
# 拷贝.zshrc模板
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc

修改.zshrc配置(Optional)

1
2
3
4
5
6
7
8
9
10
11
12
# oh-my-zsh目录 Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh
# oh-my-zsh主题
ZSH_THEME="michelebologna" #
# ZSH_THEME="gentoo" # 备选1
DISABLE_AUTO_UPDATE="true"
plugins=(git)
export LC_ALL=C
source $ZSH/oh-my-zsh.sh

更多oh-my-zsh主题

.zshrc其他配置规则和.bashrc几乎一样

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#shortcut
alias em='/usr/bin/emacs'
alias ll='ls -l'
alias la='ls -a'
alias les='less -S -x4'
alias ks='ls'
alias ch='chmod +x'
alias ee='exit'
alias tt='top -u wanglizhong'
alias sourcerc='source ~/.zshrc'
alias head1='head -1'
alias githelp='cat /home/wanglizhong/helpfile/git'
# tmux
alias tls='tmux ls'
alias tnew='tmux new -s'
alias tatt='tmux att -t'
alias tkill='tmux kill-session -t'
# help
alias find-help='cat /home/wanglizhong/tools/find'
alias awk-help='cat /home/wanglizhong/tools/awk'
# qsub
alias qs='qstat|sort -t" " -k1 -n|les -N'
alias qd='qdel'
alias qj='qstat -j'
# PATH
export R_LIBS=/ifshk7/BC_PS/wanglizhong/R:$R_LIBS # !!!!!
export PERL5LIB=/ifshk7/BC_PS/wanglizhong/perl5:/home/wanglizhong/software/vcftools/vcftools-build/lib/perl5/site_perl/5.8.8:$PERL5LIB
export LD_LIBRARY_PATH=/ifshk4/BC_PUB/biosoft/pipe/bc_paap/01.Usr/lib:/ifshk7/BC_PS/wanglizhong/lib64:/ifshk7/BC_PS/wanglizhong/lib:$LD_LIBRARY_PATH
export PATH=/ifshk7/BC_PS/wanglizhong/bin:$PATH