# linux 常见命令
- rpm -q centos-release
# 查看是否安装ssh
- rpm -qa | grep ssh
- 没有则 yum install openssh-server
- /etc/init.d/sshd status|start|stop
- netstat -antp | grep sshd
- 查看运行级别 chkconfig --list sshd
- 开启 chkconfig --level 2345 sshd on
- 开机启动 chkconfig sshd on
# 安装go语言 通过源
- rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
- yum install golang -y
- 查看go所在目录然后配置环境变量
- export PATH=$PATH:$GOPATH/bin
# 升级centos6的gcc到4.8
- wget http://people.centos.org/tru/devtools-2/devtools-2.repo
- mv devtools-2.repo /etc/yum.repos.d
- yum install devtoolset-2-gcc devtoolset-2-binutils devtoolset-2-gcc-c
保存以前的gcc mv /usr/bin/gcc /usr/bin/gcc-4.4.7 mv /usr/bin/g
# 查看动态库所在的包名
- yum whatprovides /usr/lib64/libopcodes-2.20.51.0.2-5.48.el6_10.1.so
- 最好写全路径
# 查看进程的socket连接数
ls /proc/18709/fd -l | grep socket: | wc -l #18709是进程ID
1