centos常用命令

sudo 取消密码

编辑 /etc/sudoers 文件
找到 root ALL=(ALL) …
在下面加入用户名 tyler ALL=(ALL) NOPASSWD:ALL

如果不成功可能是刚添加的语句被 %wheel ALL=(ALL) ALL 这句覆盖了。

查看用户组 id tyler 是否在 wheel 组中
把上面的语句放到 wheel 后面即可

查看yum安装路径

rpm -qa|grep 软件包名
rpm -ql 软件包名

查看端口和PID

mysqld进程在监听4567端口,进程id是2593:
# ss -lnp|grep 4567
tcp LISTEN 0 128 *:4567 *:* users:(("mysqld",2593,11))

2593的父进程是2592:
# ps -ef|grep 2593
mysql 2593 2592 0 04:46 ? 00:00:57 /usr/libexec/mysqld --wsrep-cluster-address=gcomm://