Centos8安裝zsh的步驟

改源

  1. 備份你的原鏡像文件,以免出錯后可以恢復(fù)。

     mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
    
    
  2. 下載新的CentOS-Base.repo 到/etc/yum.repos.d/

    wget -O /etc/yum.repos.d/CentOS-Base.repo [<http://mirrors.aliyun.com/repo/Centos-6.repo>](<http://mirrors.aliyun.com/repo/Centos-6.repo>)
    
    
    1. 如果沒有安裝wget,可以運行下面命令,安裝wget

       yum -y install wget
      
      
    2. 如果你的系統(tǒng)是其他版本可以查看http://mirrors.aliyun.com/repo/

       wget -O /etc/yum.repos.d/CentOS-Base.repo [<http://mirrors.aliyun.com/repo/Centos-8.repo>](<http://mirrors.aliyun.com/repo/Centos-5.repo>)
      
      
  3. 運行yum makecache生成緩存

     yum makecache
    
    

安裝zsh

  1. 安裝

     yum install -y zsh
    
    
  2. 驗證

     cat /etc/shells
    
    
  3. 切換默認(rèn)shellzsh. Changing shell for 當(dāng)前用戶.

     chsh -s /bin/zsh
    
    
    1. 關(guān)閉當(dāng)前終端,重新連接。
    2. 重新連接后可能遇到這種問題。xjb選選吧,或者直接選1。
image.png

image.png

image.png
  1. 驗證

     echo $SHELL
    
    
  2. 安裝oh-my-zsh

    1. 安裝git

       sudo yum install git
      
      
    2. 安裝oh-my-zsh

       wget [<https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh>](<https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh>) -O - | sh
      
      
    3. 查看主題

       ls ~/.oh-my-zsh/themes
      
      
  3. 安裝插件

    插件安裝在 ~/.oh-my-zsh/plugins/incr目錄(沒有則新建),安裝下面插件時,需要先cd到這一級目錄。

    1. 自動提示插件incr-0.2.zsh

       wget <http://mimosa-pudica.net/src/incr-0.2.zsh>
       echo 'source ~/.oh-my-zsh/plugins/incr/incr*.zsh' >> ~/.zshrc
       source ~/.zshrc
      
      
  4. 設(shè)置命令簡寫

    例子:把clear命令可以簡寫成c

    具體操作步驟如下

    1. vim ~/.zshrc

    2. 隨便找地方加入這條命令 alias c = "clear"

image.png
  1. 執(zhí)行命令
    source ~/.zshrc
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

友情鏈接更多精彩內(nèi)容