var aa = ["12", "34", "", "423", " "]; console.log($.grep(aa, function(n) {return $.trim(n).length > 0;})) var aaa = aa.filter(s => $.trim(s).length > ...
分类:
编程语言 时间:
2020-08-05 19:44:37
阅读次数:
186
##1.显示三个用户root、 mage、 wang的UID和默认shell 案例思路 **分析:**使用^和|匹配出三个用户,在用cut取列。 [root@localhost data]# cat /etc/passwd |grep -E "^(root|mage|wang)"|cut -d: - ...
分类:
其他好文 时间:
2020-08-05 18:12:39
阅读次数:
87
1 2 root@ubuntu:/home/ubuntu# lspci |grep -i vga 02:00.0 VGA compatible controller: NVIDIA Corporation GM200 [GeForce GTX TITAN X] (rev a1) 显示当前GPU使用情 ...
分类:
其他好文 时间:
2020-08-05 14:28:49
阅读次数:
79
CentOS查看CPU、内存、版本等系统信息 CentOS查看系统信息 一:查看CPU more /proc/cpuinfo | grep "model name" grep "model name" /proc/cpuinfo 如果觉得需要看的更加舒服 grep "model name" /pro ...
分类:
其他好文 时间:
2020-08-05 10:32:07
阅读次数:
71
首先, linux下CPU的相关信息都保存在/proc/cpuinfo文件内,所以第一步是: cat /proc/cpuinfo 然后,每个cpu的线程都对应一个physical id属性,这个属性标定线程属于哪个具体的物理cpu编号,因此接下来: cat /proc/cpuinfo | grep ...
分类:
系统相关 时间:
2020-08-04 23:58:09
阅读次数:
82
简介正则表达式其主要作用是通过一些拥有特殊含义得字符,完成日常工作中我们需要得特定字符串匹配,或者从输出内容中匹配出符合我们需要得内容。分类基础正则表达式扩展正则表达式基础正则表达式扩展正则表达式
分类:
系统相关 时间:
2020-08-03 18:42:50
阅读次数:
85
linux中mysql忘记root密码如何登陆 1.关闭mysql服务 systemctl stop mysqld netstat -tunlp|grep mysqld 2.进入配置文件添加一条命令 [mysqld] skip-grant-tables #以安全模式启动 3.重新启动服务 syste ...
分类:
数据库 时间:
2020-08-01 12:45:26
阅读次数:
120
安装JDK linux的opt目录下创建文件夹module和software fileZilla上传压缩包到software目录下 查看是否已经安装jdkrpm -qa | grep java,卸载rpm -e --nodeps 加你要卸载的对象的名字 解压安装包到module目录下:tar -zx ...
分类:
系统相关 时间:
2020-07-29 21:51:45
阅读次数:
92
1.node节点上的脚本 [root@db02 ~]# vim start_mha.sh #/bin/bash # 判断数据库是否挂掉 mysql_pid=`ps -ef | grep [m]ysqld | wc -l` # 如果挂掉则重启,如果没挂则杀掉重启 if [ $mysql_pid -eq ...
分类:
其他好文 时间:
2020-07-29 21:47:01
阅读次数:
67
1.思路 1.找到新的主库 2.将新的主库从Atlas中配置下线 3.保存到配置文件 2.写脚本 [root@db03 ~]# vim switch_Atlas.sh #/bin/bash #1.获取新的主库IP new_master=`grep "as a new master" /service ...
分类:
其他好文 时间:
2020-07-29 21:38:03
阅读次数:
63