Linux--奇思淫才

根据进程号找到可执行的文件路径

[ec2-user@baolin ~]$ ll /proc/<pid>/exe 
lrwxrwxrwx 1 ec2-user ec2-user 0 May 30 06:41 /proc/<pid>/exe -> /usr/local/java/jdk1.7.0_79/bin/java

mysql单条语句生成insert sql语句

[ec2-user@baolin ~]$ mysqldump -h 192.1688.50.100 -t -uroot -p baolin_rel tbl_ap_version_i --where="vers_id < 100" >   tbl_ap_version_i.sql                 
Enter password: 

mysql查看表的列信息

MariaDB [adsdk_rel]> show full columns from 表名;
+-----------------+--------------+-----------------+------+-----+---------+----------------+---------------------------------+-------------+
| Field           | Type         | Collation       | Null | Key | Default | Extra          | Privileges                      | Comment     |
+-----------------+--------------+-----------------+------+-----+---------+----------------+---------------------------------+-------------+
| usin_id         | int(10)      | NULL            | NO   | PRI | NULL    | auto_increment | select,insert,update,references |             |
| usin_deviceId   | varchar(100) | utf8_general_ci | NO   |     | NULL    |                | select,insert,update,references | 设备ID      |
| usin_appId      | varchar(10)  | utf8_general_ci | NO   |     | NULL    |                | select,insert,update,references | APP应用ID   |
| usin_createTime | datetime     | NULL            | NO   |     | NULL    |                | select,insert,update,references | 日期        |
+-----------------+--------------+-----------------+------+-----+---------+----------------+---------------------------------+-------------+
4 rows in set (0.01 sec)

查看Linux的网关

[root@linux_base#>> ~]#route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.100.2   0.0.0.0         UG    0      0        0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U     1002   0        0 eth0
192.168.100.0   0.0.0.0         255.255.255.0   U     0      0        0 eth0

通过sshpass实现对秘钥的分发

# 安装 sshpass
# yum install sshpass -y
# 生成本地key 
# ssh-keygen

[root@linux-node1#>> ~]#egrep -v "#|^$" scp_key.sh 
IP="
192.168.100.11
192.168.100.12
192.168.100.13
"
for node in ${IP};do
  sshpass -p 123456 ssh-copy-id  -p22 ${node}  -o StrictHostKeyChecking=no
    if [ $? -eq 0 ];then
    echo "${node} 秘钥copy完成,准备环境初始化....."
       scp -P22 /etc/hosts ${node}:/etc/hosts
       echo "${node} host 文件拷贝完成"
    fi
done

猜你喜欢

转载自www.cnblogs.com/baolin2200/p/9337330.html