安装pcstat命令

下载go包

wget https://dl.google.com/go/go1.18.3.linux-amd64.tar.gz

 

解压

tar xf go1.18.3.linux-amd64.tar.gz

mv go /usr/local/

 

设置环境变量

vim /etc/profile

--------------------------------

export GOROOT=/usr/local/go

export GOPATH=/usr/local/gocode

export PATH=$PATH:$GOROOT/bin:$GOPATH

--------------------------------

source /etc/profile

 

安装pcstat

mkdir -p $GOPATH/src/golang.org/x

cd $GOPATH/src/golang.org/x

git clone https://github.com/golang/sys.git

mkdir -p $GOPATH/src/github.com/tobert

cd $GOPATH/src/github.com/tobert

git clone https://github.com/tobert/pcstat.git

cd tobert

go build

cp pcstat /usr/local/sbin/

 

posted @ 2022-07-03 15:05  道霖  阅读(331)  评论(0编辑  收藏  举报