Zsh 详解

Zsh 官网 : https://www.zsh.org/
oh-my-Zsh 官网 : http://ohmyz.sh/

Zsh 和 oh-my-Zsh 的关系
Zsh 是 Shell 中的一种,什么 Shell 你可以再搜索下,简单粗暴讲就是一个:命令解释器,你输入什么命令,它就执行什么,这个东西再 Unix 世界还有其他几个。由于 Zsh 配置门槛有点高,或者说需要专门花时间去了解 Zsh 才能配置好一个好用的 Zsh,也因为这样,用户也就相对少了。直到有一天 oh-my-Zsh 的作者诞生,他想要整理出一个配置框架出来,让大家直接使用他的这个公认最好的 Zsh 配置,省去繁琐的配置过程。所以,oh-my-Zsh 就诞生了,它只是会了让你减少 Zsh 的配置,然后又可以好好享受 Zsh 这个 Shell

Mac
查看 Mac 中支持终端
$ cat /etc/shells
# List of acceptable shells for chpass(1).
# Ftpd will not allow users to connect who are not using
# one of these shells.

/bin/bash
/bin/csh
/bin/ksh
/bin/sh
/bin/tcsh
/bin/zsh

默认情况下 Mac 已经安装 Zsh,如果没有可以手动安装 : $ brew install Zsh

装了 zsh 之后,修改终端配置就变成 :   vim ~/.zshrc ,而不是 : vim ~/.bash_profile ,所以以后看到别人的文章中需要 : vim ~/.bash_profile ,需要变通思想过来

同时更新修改后的配置文件也从 : source ~/.bash_profile ,变成 : source ~/.zshrc ,当然还有其他取巧方式,这里不谈


Linux 环境下的 Zsh 配置
Linux 中安装 Zsh
$ echo $SHELL    # 查看当前系统的 shell
/bin/bash

# yum install zsh

# cat /etc/shells
/bin/sh
/bin/bash
/sbin/nologin
/usr/bin/sh
/usr/bin/bash
/usr/sbin/nologin
/bin/zsh

# chsh -s /bin/zsh    # 切换 zsh

# reboot    # 重启生效

echo $SHELL    # 重启后检查是否使用 zsh
/bin/zsh

安装 oh-my-Zsh 套件
# 需要从 GitHub 上下载脚本因此需要安装 git
# yum install git

正在解析主机 github.com (github.com)... 192.30.253.112, 192.30.253.113
正在连接 github.com (github.com)|192.30.253.112|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 302 Found
正在解析主机 raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.0.133, 151.101.64.133, 151.101.128.133, ...
正在连接 raw.githubusercontent.com (raw.githubusercontent.com)|151.101.0.133|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:4019 (3.9K) [text/plain]
正在保存至: “STDOUT”

100%[======================================>] 4,019       --.-K/s 用时 0s

2018-03-17 12:15:38 (75.2 MB/s) - 已写入至标准输出 [4019/4019]

Cloning Oh My Zsh...
正克隆到 '/root/.oh-my-zsh'...
remote: Counting objects: 852, done.
remote: Compressing objects: 100% (716/716), done.
remote: Total 852 (delta 16), reused 787 (delta 10), pack-reused 0
接收对象中: 100% (852/852), 581.12 KiB | 128.00 KiB/s, done.
处理 delta 中: 100% (16/16), done.
Looking for an existing zsh config...
Using the Oh My Zsh template file and adding it to ~/.zshrc
         __                                     __
  ____  / /_     ____ ___  __  __   ____  _____/ /_
/ __ \/ __ \   / __ `__ \/ / / /  /_  / / ___/ __ \
/ /_/ / / / /  / / / / / / /_/ /    / /_(__  ) / / /
\____/_/ /_/  /_/ /_/ /_/\__, /    /___/____/_/ /_/
                        /____/                       ....is now installed!


Please look over the ~/.zshrc file to select plugins, themes, and options.

p.s. Follow us at https://twitter.com/ohmyzsh.

p.p.s. Get stickers and t-shirts at https://shop.planetargon.com.

重新启动 terminal 就可以看到非常清爽的 oh-my-Zsh 界面


  • 0
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值