zsh: command not found 的部分解决方案

Golang的 解决方案方案,

#
# GOROOT
export PATH=$PATH:/usr/local/go/bin


#GOPATH
export GOPATH=$HOME/go_place
export PATH=$PATH:$GOPATH/bin

  Golang的安装

  Go下载 - Go语言中文网 - Golang中文社区

 复制Golang的linux下载链接

wget -c https://studygolang.com/dl/golang/go1.19.linux-amd64.tar.gz
tar -zxvf go1.19.linux-amd64.tar.gz
sudo mv go /usr/local

Golang在zsh下的配置

cd ~
vim .zshrc

# 将下面的内容添加到.zshrc 中
#
# GOROOT
export PATH=$PATH:/usr/local/go/bin


#GOPATH
export GOPATH=$HOME/go_place
export PATH=$PATH:$GOPATH/bin

# ESC :wq保存后

source .zshrc  # 就可以了

 这里的基本思路就是以前golang的环境配置在bash下的profile,这里是添加到zsh的环境配置

anaconda的环境配置

anaconda/bin/conda init zsh

这里基本思路就是用conda自己自动初始化zsh

 最后写一些oh my zsh的配置

sudo apt install zsh

ubuntu默认shell是bash,apt安装zsh之后直接用oh my zsh的命令就可以自动切换到oh my zsh

# Github

# Curl 安装 
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

# Wget
sh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"


#Gitee

sh -c "$(curl -fsSL https://gitee.com/mirrors/oh-my-zsh/raw/master/tools/install.sh)"

#Wget

sh -c "$(wget -O- https://gitee.com/pocmon/mirrors/raw/master/tools/install.sh)"

 安装输出如下:

xxxx% sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" 
Cloning Oh My Zsh...
Cloning into '/Users/xxxx/.oh-my-zsh'...
remote: Counting objects: 831, done.
remote: Compressing objects: 100% (700/700), done.
remote: Total 831 (delta 14), reused 775 (delta 10), pack-reused 0
Receiving objects: 100% (831/831), 567.67 KiB | 75.00 KiB/s, done.
Resolving deltas: 100% (14/14), done.
Looking for an existing zsh config...
Found ~/.zshrc. Backing up to ~/.zshrc.pre-oh-my-zsh
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 http://shop.planetargon.com.

Oh My Zsh 是什么

  • Oh My Zsh 是一款社区驱动的命令行工具,正如它的主页上说的,Oh My Zsh 是一种生活方式。它基于 zsh 命令行,提供了主题配置,插件机制,已经内置的便捷操作。给我们一种全新的方式使用命令行。
  • Oh My Zsh 是基于 zsh 命令行的一个扩展工具集,提供了丰富的扩展功能。
  • 安装 Oh My Zsh 前提条件:必须已安装 zsh

版权声明:本文为C0ach原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。