Linux备忘录
终端美化
ZSH
安装zsh, oh-my-zsh
# 安装zsh
sudo apt-get install zsh
# 安装oh-my-zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
source .zshrc
# 配置zsh主题
sudo vim .zshrc
ZSH_THEME="ys"
# 插件
# 自动转跳
sudo apt-get install autojump
echo '. /usr/share/autojump/autojump.sh'>>~/.zshrc
vim ~/.zshrc
plugins=(
git
zsh-syntax-highlighting
)
插件
自动转跳 autojump
sudo apt-get install autojump
// Centos, Debian 配置不同
shell语法着色 zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
plugins=( [plugins...] zsh-syntax-highlighting)
自动建议 zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
plugins=( [plugins...] zsh-autosuggestions)
错误提醒 thefuck
sudo apt update
sudo apt install python3-dev python3-pip python3-setuptools
sudo pip3 install thefuck
fuck
常用命令
alias | grep git # 指令别名
tail -f ./test.log # 监控文件
用户
useradd wuxie0ne // 新建用户
passwd wuxie0ne // 设置密码
sudo vim /etc/sudoers // 授予root权限
// 添加 wuxie0ne ALL=(ALL) ALL