This post was written for reminding myself of some useful command snippets in Linux etc.

rpm

command description
rpm -aq | grep yum 查找 rpm 包
rpm -e xxx.yyy 删除
rpm -ivh 安装 i->install v->verbose h->justForBetter
rpm -qi yum-3.4.3-132.el7.centos.0.1.noarch 已安装包的信息
rpm -qip xxx.rpm 查看 rpm 包信息
rpm -qRp 查看依赖

go

command description
go build -gcflags=-m inline.go 查看函数内联
GOOS=linux GOARCH=arm go
GOOS=windows GOARCH=386 CGO_ENABLED=0 go xx

tar

command description
tar -zxvf 解 tar.gz
tar -zcvf 压 tar.gz

journalctl

command description
-n xxx 尾部 xxx行
-f follow
-k 内核日志
-u docker.service xxx.service
-o json-pretty
-b 本次启动
-p err x

yum

command description
yum install -y epel-release epel

apt

command description
apt-cache policy list all version
apt-cache depends see depends

template

command description
todo todo

Centos things

1
2
3
4
5
6
yum install -y vim
yum install -y build-essential
yum install -y epel-release
yum install -y nload htop iotop
yum install -y traceroute
yum install -y bridge-utils

Centos install python3.6

1
2
3
4
5
6
7
8
yum -y update
yum -y install yum-utils
yum -y groupinstall development
yum -y install https://centos7.iuscommunity.org/ius-release.rpm
yum -y install python36u
python3.6 -V
yum -y install python36u-pip
yum -y install python36u-devel