博客pgrep,pidof工具的使用

最灵活:ps 选项 | 其它命令
按预定义的模式:pgrep
pgrep [options] pattern
-u uid: effective user,生效者
-U uid: real user,真正发起运行命令者
-t terminal: 与指定终端相关的进程
-l: 显示进程名
-a: 显示完整格式的进程名
-P pid: 显示指定进程的子进程
按确切的程序名称:/sbin/pidof

一-t terminal: 显示与指定终端相关的进程

[root@centos72 ~]# pgrep   -t  pts/1
[root@centos72 ~]# pgrep -t pts/3
[root@centos72 ~]# tty
/dev/pts/2
[root@centos72 ~]# pgrep -t pts/2
[root@centos72 ~]# pstree -p
systemd(1)─┬─NetworkManager(544)─┬─{NetworkManager}(591)
│ └─{NetworkManager}(593)
├─VGAuthService(545)
├─agetty(558)
├─auditd(515)───{auditd}(516)
├─crond(555)
├─dbus-daemon(540)───{dbus-daemon}(542)
├─httpd(2295)─┬─httpd(2296)
│ ├─httpd(2297)
│ ├─httpd(2298)
│ ├─httpd(2299)
│ └─httpd(2300)
├─irqbalance(538)
├─master(869)─┬─pickup(2590)
│ └─qmgr(871)
├─polkitd(539)─┬─{polkitd}(541)
│ ├─{polkitd}(543)
│ ├─{polkitd}(569)
│ ├─{polkitd}(570)
│ └─{polkitd}(573)
├─rsyslogd(787)─┬─{rsyslogd}(790)
│ └─{rsyslogd}(791)
├─sshd(785)─┬─sshd(2053)───bash(2057)─┬─head(2987)
│ │ └─watch(2986)
│ └─sshd(2110)───bash(2114)───pstree(3658)
├─systemd-journal(357)
├─systemd-logind(548)
├─systemd-udevd(388)
├─tuned(784)─┬─{tuned}(1026)
│ ├─{tuned}(1027)
│ ├─{tuned}(1028)
│ └─{tuned}(1041)
└─vmtoolsd(546)───{vmtoolsd}(580)

二-l: 显示进程名

[root@centos72 ~]# pgrep   -t  pts/2  -l
2057 bash
[root@centos72 ~]# pgrep -lt pts/2
2057 bash

注意必须和t组合起来

[root@centos72 ~]# pgrep   -lt  pts/1
1259 bash
[root@centos72 ~]# pgrep -l pts/1

三-a: 显示完整格式的进程名

注意t选项是不可少的

[root@centos72 ~]# pgrep   -at  pts/1
1259 -bash
[root@centos72 ~]# pgrep -a pts/1
[root@centos72 ~]# pgrep -a pts/

在一个终端上查看另外一个终端的进程

[root@centos72 ~]# pgrep   -at  pts/3
2114 -bash
3840 su - wang
3841 -bash
3864 passwd
[root@centos72 ~]# tty
/dev/pts/

另外一个终端

[root@centos72 ~]# tty
/dev/pts/3
[root@centos72 ~]# su - wang
Last login: Sat May 18 16:20:19 CST 2019 on pts/3
[wang@centos72 ~]$ passwd
Changing password for user wang.
Changing password for wang.
(current) UNIX password:

注意a选项不能在t后面,否则不会显示。因为t后面必须是终端,a相当于小三

[root@centos72 ~]# pgrep   -ta  pts/3
[root@centos72 ~]# pgrep -ta pts/2
[root@centos72 ~]# pgrep -ta pts/

四-P pid: 显示指定进程的子进程

[root@centos72 ~]# pgrep   -at  pts/3
2114 -bash
3840 su - wang
3841 -bash
3864 passwd
[root@centos72 ~]# pgrep -P 3840
[root@centos72 ~]# pstree -p
systemd(1)─┬─NetworkManager(544)─┬─{NetworkManager}(591)
│ └─{NetworkManager}(593)
├─VGAuthService(545)
├─agetty(558)
├─auditd(515)───{auditd}(516)
├─crond(555)
├─dbus-daemon(540)───{dbus-daemon}(542)
├─httpd(2295)─┬─httpd(2296)
│ ├─httpd(2297)
│ ├─httpd(2298)
│ ├─httpd(2299)
│ └─httpd(2300)
├─irqbalance(538)
├─master(869)─┬─pickup(2590)
│ └─qmgr(871)
├─polkitd(539)─┬─{polkitd}(541)
│ ├─{polkitd}(543)
│ ├─{polkitd}(569)
│ ├─{polkitd}(570)
│ └─{polkitd}(573)
├─rsyslogd(787)─┬─{rsyslogd}(790)
│ └─{rsyslogd}(791)
├─sshd(785)─┬─sshd(2053)───bash(2057)───pstree(3875)
│ └─sshd(2110)───bash(2114)───su(3840)───bash(3841)───passwd(3864)
├─systemd-journal(357)
├─systemd-logind(548)
├─systemd-udevd(388)
├─tuned(784)─┬─{tuned}(1026)
│ ├─{tuned}(1027)
│ ├─{tuned}(1028)
│ └─{tuned}(1041)
└─vmtoolsd(546)───{vmtoolsd}(580)

五-u uid: effective user,生效者

[root@centos72 ~]# su  - wang
Last login: Sat May 18 16:20:19 CST 2019 on pts/3
[wang@centos72 ~]$ passwd
Changing password for user wang.
Changing password for wang.
(current) UNIX password:
[root@centos72 ~]# pgrep  -lu  wang
3841 bash

注意pgrep, pkill两个命令的帮助文档是一样的

PGREP(1)                                    User Commands                                    PGREP(1)

NAME
pgrep, pkill - look up or signal processes based on name and other attributes

还支持扩展的正则表达式

因为pgrep是ps和grep的结合

OPERANDS
pattern
Specifies an Extended Regular Expression for matching against the process names or com‐
mand lines.

六结合正则表达式

注意可以使用ps结合grep也可以搜索出来的

[root@centos72 ~]# su  - wang
Last login: Sat May 18 16:21:27 CST 2019 on pts/3
[wang@centos72 ~]$ passwd
Changing password for user wang.
Changing password for wang.
(current) UNIX password:
[root@centos72 ~]# pgrep   -l  "pass.*"
3928 passwd
[root@centos72 ~]# pgrep   -l  "ba.*"
21 writeback
538 irqbalance
2057 bash
2114 bash
3904 bash
[root@centos72 ~]# pgrep -l "bas.*"
2057 bash
2114 bash
3904 bash

七按确切的程序名称:pidof   bash

[root@centos72 ~]# pgrep   -l  "bas.*"
2057 bash
2114 bash
3904 bash
[root@centos72 ~]# pidof bash
3904 2114
[root@centos72 ~]# pstree -p
systemd(1)─┬─NetworkManager(544)─┬─{NetworkManager}(591)
│ └─{NetworkManager}(593)
├─VGAuthService(545)
├─agetty(558)
├─auditd(515)───{auditd}(516)
├─crond(555)
├─dbus-daemon(540)───{dbus-daemon}(542)
├─httpd(2295)─┬─httpd(2296)
│ ├─httpd(2297)
│ ├─httpd(2298)
│ ├─httpd(2299)
│ └─httpd(2300)
├─irqbalance(538)
├─master(869)─┬─pickup(2590)
│ └─qmgr(871)
├─polkitd(539)─┬─{polkitd}(541)
│ ├─{polkitd}(543)
│ ├─{polkitd}(569)
│ ├─{polkitd}(570)
│ └─{polkitd}(573)
├─rsyslogd(787)─┬─{rsyslogd}(790)
│ └─{rsyslogd}(791)
├─sshd(785)─┬─sshd(2053)───bash(2057)───pstree(3936)
│ └─sshd(2110)───bash(2114)───su(3903)───bash(3904)───passwd(3928)
├─systemd-journal(357)
├─systemd-logind(548)
├─systemd-udevd(388)
├─tuned(784)─┬─{tuned}(1026)
│ ├─{tuned}(1027)
│ ├─{tuned}(1028)
│ └─{tuned}(1041)
└─vmtoolsd(546)───{vmtoolsd}(580)

在6上设置httpd为没有线程的进程

[root@centos65 ~]# diff   /etc/sysconfig/httpd{,.bak}
[root@centos65 ~]# cat /etc/sysconfig/httpd
# Configuration file for the httpd service. #
# The default processing model (MPM) is the process-based
# 'prefork' model. A thread-based model, 'worker', is also
# available, but does not work with some modules (such as PHP).
# The service must be stopped before changing this variable.
#
#HTTPD=/usr/sbin/httpd.worker #
# To pass additional options (for instance, -D definitions) to the
# httpd binary at startup, set OPTIONS here.
#
#OPTIONS= #
# By default, the httpd process is started in the C locale; to
# change the locale in which the server runs, the HTTPD_LANG
# variable can be set.
#
#HTTPD_LANG=C #
# By default, the httpd process will create the file
# /var/run/httpd/httpd.pid in which it records its process
# identification number when it starts. If an alternate location is
# specified in httpd.conf (via the PidFile directive), the new
# location needs to be reported in the PIDFILE.
#
#PIDFILE=/var/run/httpd/httpd.pid
[root@centos65 ~]# service httpd restart
Stopping httpd: [ OK ]
Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using centos65.jd.com for ServerName
[ OK ]
[root@centos65 ~]#
[root@centos65 ~]# pstree -p
init(1)─┬─abrt-dump-oops(1811)
├─abrtd(1801)
├─acpid(1428)
├─atd(1858)
├─auditd(1251)───{auditd}(1252)
├─automount(1511)─┬─{automount}(1512)
│ ├─{automount}(1513)
│ ├─{automount}(1528)
│ └─{automount}(1531)
├─crond(1843)
├─dbus-daemon(1389)───{dbus-daemon}(1391)
├─dnsmasq(2023)
├─hald(1440)─┬─hald-runner(1441)─┬─hald-addon-acpi(1495)
│ │ └─hald-addon-inpu(1473)
│ └─{hald}(1442)
├─httpd(12606)─┬─httpd(12608)
│ ├─httpd(12609)
│ ├─httpd(12610)
│ ├─httpd(12611)
│ ├─httpd(12612)
│ ├─httpd(12613)
│ ├─httpd(12614)
│ └─httpd(12615)
├─irqbalance(1307)
├─ksmtuned(1830)───sleep(12576)
├─libvirtd(1875)─┬─{libvirtd}(1876)
│ ├─{libvirtd}(1877)
│ ├─{libvirtd}(1878)
│ ├─{libvirtd}(1879)
│ ├─{libvirtd}(1880)
│ ├─{libvirtd}(1881)
│ ├─{libvirtd}(1882)
│ ├─{libvirtd}(1883)
│ ├─{libvirtd}(1884)
│ └─{libvirtd}(1885)
├─master(1772)─┬─pickup(11801)
│ └─qmgr(1779)
├─mingetty(1916)
├─mingetty(1918)
├─mingetty(1920)
├─mingetty(1922)
├─mingetty(1924)
├─mingetty(1926)
├─rpc.idmapd(1633)
├─rpc.mountd(1588)
├─rpc.rquotad(1583)
├─rpc.statd(1354)
├─rpcbind(1332)
├─rsyslogd(1273)─┬─{rsyslogd}(1274)
│ ├─{rsyslogd}(1276)
│ └─{rsyslogd}(1277)
├─sshd(1682)───sshd(2134)───bash(2138)───pstree(12619)
├─udevd(536)─┬─udevd(1933)
│ └─udevd(1934)
└─xinetd(1693)
[root@centos65 ~]# pidof  httpd
12615 12614 12613 12612 12611 12610 12609 12608

停止服务,返回值为1

[root@centos65 ~]# service httpd  stop
Stopping httpd: [ OK ]
[root@centos65 ~]# pidof httpd
[root@centos65 ~]# echo  $?

重启服务之后显示为0

pidof httpd的作用就是检查进程是否正常工作,如果进程死了那么就要激活

[root@centos65 ~]# service httpd  restart
Stopping httpd: [ OK ]
Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using centos65.jd.com for ServerName
[ OK ]
[root@centos65 ~]# pidof httpd
12723
[root@centos65 ~]# echo $?

脚本之间是可以自己调用自己

如果服务运行那么就什么也不做,否则就重启服务

[root@centos65 ~]# pstree -p
init(1)─┬─abrt-dump-oops(1811)
├─abrtd(1801)
├─acpid(1428)
├─atd(1858)
├─auditd(1251)───{auditd}(1252)
├─automount(1511)─┬─{automount}(1512)
│ ├─{automount}(1513)
│ ├─{automount}(1528)
│ └─{automount}(1531)
├─crond(1843)
├─dbus-daemon(1389)───{dbus-daemon}(1391)
├─dnsmasq(2023)
├─hald(1440)─┬─hald-runner(1441)─┬─hald-addon-acpi(1495)
│ │ └─hald-addon-inpu(1473)
│ └─{hald}(1442)
├─httpd(12723)─┬─httpd(12726)
│ ├─httpd(12727)
│ ├─httpd(12728)
│ ├─httpd(12729)
│ ├─httpd(12730)
│ ├─httpd(12731)
│ ├─httpd(12732)
│ └─httpd(12733)
├─irqbalance(1307)
├─ksmtuned(1830)───sleep(13100)
├─libvirtd(1875)─┬─{libvirtd}(1876)
│ ├─{libvirtd}(1877)
│ ├─{libvirtd}(1878)
│ ├─{libvirtd}(1879)
│ ├─{libvirtd}(1880)
│ ├─{libvirtd}(1881)
│ ├─{libvirtd}(1882)
│ ├─{libvirtd}(1883)
│ ├─{libvirtd}(1884)
│ └─{libvirtd}(1885)
├─master(1772)─┬─pickup(11801)
│ └─qmgr(1779)
├─mingetty(1916)
├─mingetty(1918)
├─mingetty(1920)
├─mingetty(1922)
├─mingetty(1924)
├─mingetty(1926)
├─rpc.idmapd(1633)
├─rpc.mountd(1588)
├─rpc.rquotad(1583)
├─rpc.statd(1354)
├─rpcbind(1332)
├─rsyslogd(1273)─┬─{rsyslogd}(1274)
│ ├─{rsyslogd}(1276)
│ └─{rsyslogd}(1277)
├─sshd(1682)─┬─sshd(2134)───bash(2138)
│ └─sshd(12948)───bash(12961)───pstree(13101)
├─udevd(536)─┬─udevd(1933)
│ └─udevd(1934)
└─xinetd(1693)

创建脚本

[root@centos65 ~]# vim  /bin/f1.sh
[root@centos65 ~]# ll /bin/f1.sh
-rw-r--r--. 1 root root 101 May 18 17:12 /bin/f1.sh
[root@centos65 ~]# chmod a+x /bin/f1.sh
[root@centos65 ~]# ll /bin/f1.sh
-rwxr-xr-x. 1 root root 101 May 18 17:12 /bin/f1.sh
[root@centos65 ~]# echo $PATH
/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
[root@centos65 ~]# bash /bin/f1.sh
^C
[root@centos65 ~]# cat /bin/f1.sh
#!/bin/bash
sleep 2
pidof httpd &> /dev/null || service httpd restart &> /dev/null
f1.sh

执行脚本

生成了很多的子进程,不能显示全部的,所以就显示+

sshd(1682)─┬─sshd(2134)───bash(2138)───bash(13112)───f1.sh(13116)───f1.sh(13121)───f1.sh(1312+

[root@centos65 ~]# pstree -p
init(1)─┬─abrt-dump-oops(1811)
├─abrtd(1801)
├─acpid(1428)
├─atd(1858)
├─auditd(1251)───{auditd}(1252)
├─automount(1511)─┬─{automount}(1512)
│ ├─{automount}(1513)
│ ├─{automount}(1528)
│ └─{automount}(1531)
├─crond(1843)
├─dbus-daemon(1389)───{dbus-daemon}(1391)
├─dnsmasq(2023)
├─hald(1440)─┬─hald-runner(1441)─┬─hald-addon-acpi(1495)
│ │ └─hald-addon-inpu(1473)
│ └─{hald}(1442)
├─httpd(12723)─┬─httpd(12726)
│ ├─httpd(12727)
│ ├─httpd(12728)
│ ├─httpd(12729)
│ ├─httpd(12730)
│ ├─httpd(12731)
│ ├─httpd(12732)
│ └─httpd(12733)
├─irqbalance(1307)
├─ksmtuned(1830)───sleep(13111)
├─libvirtd(1875)─┬─{libvirtd}(1876)
│ ├─{libvirtd}(1877)
│ ├─{libvirtd}(1878)
│ ├─{libvirtd}(1879)
│ ├─{libvirtd}(1880)
│ ├─{libvirtd}(1881)
│ ├─{libvirtd}(1882)
│ ├─{libvirtd}(1883)
│ ├─{libvirtd}(1884)
│ └─{libvirtd}(1885)
├─master(1772)─┬─pickup(11801)
│ └─qmgr(1779)
├─mingetty(1916)
├─mingetty(1918)
├─mingetty(1920)
├─mingetty(1922)
├─mingetty(1924)
├─mingetty(1926)
├─rpc.idmapd(1633)
├─rpc.mountd(1588)
├─rpc.rquotad(1583)
├─rpc.statd(1354)
├─rpcbind(1332)
├─rsyslogd(1273)─┬─{rsyslogd}(1274)
│ ├─{rsyslogd}(1276)
│ └─{rsyslogd}(1277)
├─sshd(1682)─┬─sshd(2134)───bash(2138)───bash(13112)───f1.sh(13116)───f1.sh(13121)───f1.sh(1312+
│ └─sshd(12948)───bash(12961)───pstree(13149)
├─udevd(536)─┬─udevd(1933)
│ └─udevd(1934)
└─xinetd(1693)

一直执行脚本,并且停止httpd服务

[root@centos65 ~]# bash  /bin/f1.sh 

进程一会儿就会自动激活了

[root@centos65 ~]# service httpd  stop
Stopping httpd: [ OK ]
[root@centos65 ~]# pidof httpd
13424
[root@centos65 ~]# pidof httpd
13424
[root@centos65 ~]# pidof httpd
13424
[root@centos65 ~]# pidof httpd
13429
[root@centos65 ~]# pidof httpd
13429
[root@centos65 ~]# pidof httpd
13429
[root@centos65 ~]# pidof httpd
13449 13448 13447 13446 13445 13444 13443 13442 13429
[root@centos65 ~]# pidof httpd
13449 13448 13447 13446 13445 13444 13443 13442

在有些情况下一个脚本调用另外一个脚本

修改脚本

此脚本实际上是一种循环的变种

[root@centos65 ~]# vim  /bin/f1.sh
[root@centos65 ~]# cat /bin/f1.sh
#!/bin/bash
sleep 2
pidof httpd &> /dev/null || service httpd restart &> /dev/null
source f1.sh [root@centos65 ~]# bash /bin/f1.sh

不会生成子进程了,因为source是自己调用自己

[root@centos65 ~]# pstree -p
init(1)─┬─abrt-dump-oops(1811)
├─abrtd(1801)
├─acpid(1428)
├─atd(1858)
├─auditd(1251)───{auditd}(1252)
├─automount(1511)─┬─{automount}(1512)
│ ├─{automount}(1513)
│ ├─{automount}(1528)
│ └─{automount}(1531)
├─crond(1843)
├─dbus-daemon(1389)───{dbus-daemon}(1391)
├─dnsmasq(2023)
├─hald(1440)─┬─hald-runner(1441)─┬─hald-addon-acpi(1495)
│ │ └─hald-addon-inpu(1473)
│ └─{hald}(1442)
├─httpd(13429)─┬─httpd(13442)
│ ├─httpd(13443)
│ ├─httpd(13444)
│ ├─httpd(13445)
│ ├─httpd(13446)
│ ├─httpd(13447)
│ ├─httpd(13448)
│ └─httpd(13449)
├─irqbalance(1307)
├─ksmtuned(1830)───sleep(15221)
├─libvirtd(1875)─┬─{libvirtd}(1876)
│ ├─{libvirtd}(1877)
│ ├─{libvirtd}(1878)
│ ├─{libvirtd}(1879)
│ ├─{libvirtd}(1880)
│ ├─{libvirtd}(1881)
│ ├─{libvirtd}(1882)
│ ├─{libvirtd}(1883)
│ ├─{libvirtd}(1884)
│ └─{libvirtd}(1885)
├─master(1772)─┬─pickup(13426)
│ └─qmgr(1779)
├─mingetty(1916)
├─mingetty(1918)
├─mingetty(1920)
├─mingetty(1922)
├─mingetty(1924)
├─mingetty(1926)
├─rpc.idmapd(1633)
├─rpc.mountd(1588)
├─rpc.rquotad(1583)
├─rpc.statd(1354)
├─rpcbind(1332)
├─rsyslogd(1273)─┬─{rsyslogd}(1274)
│ ├─{rsyslogd}(1276)
│ └─{rsyslogd}(1277)
├─sshd(1682)─┬─sshd(2134)───bash(2138)───bash(15223)───sleep(15244)
│ └─sshd(12948)───bash(12961)───pstree(15246)
├─udevd(536)─┬─udevd(1933)
│ └─udevd(1934)
└─xinetd(1693)

服务停止之后还会生成进程

[root@centos65 ~]# pidof  httpd
13449 13448 13447 13446 13445 13444 13443 13442 13429
[root@centos65 ~]# service httpd stop
Stopping httpd: [ OK ]
[root@centos65 ~]# pidof httpd
15380 15379 15378 15377 15376 15375 15374 15373

监控进程的时候可以写一个类似的脚本对重要的进程进行监控,比如阿帕奇、nginx、tomcat等等,特别是在小型环境里面使用不到像zabbix这么复杂的软件。

pgrep,pidof工具的使用的更多相关文章

  1. 给Android系统安装busybox

    转自:http://blog.csdn.net/lxgwm2008/article/details/38925051 busybox号称Linux平台的瑞士军刀,它集成了100多个最常用的Linux命 ...

  2. ID

    id 编辑 身份标识号.账号.唯一编码.专属号码.工业设计.国家简称.法律词汇.通用账户.译码器.软件公司等,各类专有词汇缩写. 身份证,身份识别,是一种身份证明. 中文名 身份证,帐号,工业设计,通 ...

  3. Linux下的进程管理

    在操作系统系统中,进程是一个非常重要的概念. 一.Linux中进程的相关知识 1.什么是进程呢? 通俗的来说进程是运行起来的程序.唯一标示进程的是进程描述符(PID),在linux内核中是通过task ...

  4. 成为linux的合格公民

     前言:  该片文章献给申请linux国籍的所有瘾君子们:  还记得17年的勒索病毒感染了无数的window操作系统. 在windows上待久的公民会渴望有无另一个世界,简单的图形化操作使得一切都变的 ...

  5. Linux学习笔记03

    一.Linux常见命令 file:查看文件类型(windows用扩展名识别文件类型) 语法:file [options] [args] -b:显示结果时,不显示文件名 -c:显示执行file命令的执行 ...

  6. 马哥Linux SysAdmin学习笔记(二)

    Linux网络属性管理: 局域网:以太网,令牌环网 Ethernet:CSMA/CD 冲突域 广播域 MAC:media access control地址 48bit: 24bits 24bits  ...

  7. Linux命令行程序和内建指令

    摘录百度分类 文件系统 cat cd chmod chown chgrp cksum cmp cp du df fsck fuser ln ls lsattr lsof mkdir mount mv ...

  8. Unix分类学习

    调试 shell # bash -x script.sh 设置终端背景色 setterm -background black 一.网络 1.网卡状态 mii-tool -v ethtool eth0 ...

  9. C语言一些基础知识

    #include<bits/stdc++.h> #include<bits/stdc++.h>包含C++的所有头文件,看见别人用这个函数,然后就能直接用vector,set,s ...

随机推荐

  1. (转)利用VMware克隆虚拟机需要注意的问题

    第一步:关闭当前机器 第二步:在VMware中右键要克隆的机器 选择管理-->克隆 第三步:启动新克隆的虚拟机 修改主机名 如 hostname  slave2 第四步:修改克隆的虚拟机的ip地 ...

  2. Socket错误详解及处理方法

    例如错误代码10061, 说明服务器已经找到,但连接被服务器拒绝, 连接失败原因可能是: 端口号设置错误: 2.服务器没有处于监听状态 (即ServerSocket –>Active=true) ...

  3. idea中配置Resin运行环境

    文章目录 背景 下载resin 配置idea 背景 为了能够读Resin的源码,只看源码看不到值,故想在idea中通过断点查看. 下载resin https://caucho.com/products ...

  4. jvm 更多链接

    http://www.cnblogs.com/dingyingsi/p/3760447.html    :  讲解 jvm https://blog.csdn.net/Luomingkui1109/a ...

  5. SQL根据日期计算当月有多少天(转)

    原文链接:https://blog.csdn.net/dobear_0922/article/details/2393235 --1.删除测试用表IF OBJECT_ID(N'Test', N'U') ...

  6. PHP/HTML混写的四种方式

    [整理]PHP/HTML混写的四种方式   PHP作为一款后端语言,为了输出给浏览器让浏览器呈现出来,无可避免的要输出HTML代码,下文介绍下我用过的三种PHP/HTML混编方法 1.单/双引号包围法 ...

  7. PowerShell 远程执行命令

    PowerShell 远程执行命令 最近在做一些自动化的测试工作,在代码实现的过程中需要远程启动/关闭一些服务或者测试机. 我首先想到的是建立一个website,通过网站对一些服务进行操作,但是这样感 ...

  8. jsp:useBean的属性class值一直报错的问题

    先附上代码: <%@ page language="java" import="java.util.*" pageEncoding="UTF-8 ...

  9. mySql | Error: ER_DATA_TOO_LONG: Data too long for column 'base_info' at row 1

    问题描述:执行insert语句报以下错误 原因:数据库表,该字段在设计的时候长度过小,新插入的数据过长,会提示以上错误! 解决办法:修改表中该字段的长度限定.

  10. React Native实践总结一

    一.React的世界观1.通过改变state来改变视图视图不用考虑如何改变自己,把state画出来即可.2.变量不可变通过创建一个新的state来更改state,使得变更可追踪,不容易因为其他部分修改 ...