grep

根据运行的进程的名称杀死进程

左心房为你撑大大i 提交于 2020-01-15 01:44:47
根据运行的进程的名称杀死进程 ps -ef | grep 要杀掉的进程名称 | grep -v grep | awk ‘{print $2}’ | xargs kill -9 如: 有一个进程,我们不知道它的进程号,只知道他的进程名称是 config-center-1.0.0.5.jar ps -ef | grep config-center-1.0.0.5.jar | grep -v grep | awk ‘{print $2}’ | xargs kill -9 来源: CSDN 作者: 遇水则生 链接: https://blog.csdn.net/xiaojuge/article/details/103977281

Ubuntu系统下USB转串口的使用

房东的猫 提交于 2020-01-14 20:09:56
PC系统是Ubuntu12.04,与路由器开发板之间用USB转串口线连接。 一、硬件连接 确认Ubuntu对USB转串口设备的支持。 1、# lsmod | grep usbserial 如果有usbserial,说明系统支持USB转串口。 zlf@zlf:~$ lsmod |grep usbserial usbserial 39125 3 ftdi_sio 2、插上USB转串口,在终端输入命令 # dmesg | grep ttyUSB0 ,如果出现连接成功信息,则说明ubuntu系统已经识别该设备了。 zlf@zlf:~$ dmesg | grep tty [ 0.000000] console [tty0] enabled [ 1.854936] 0000:00:03.3: ttyS4 at I/O 0x1830 (irq = 17, base_baud = 115200) is a 16550A [ 920.550979] usb 6-1: FTDI USB Serial Device converter now attached to ttyUSB0 二、软件选用 这里使用minicom,一款linux系统下的串口通信软件,全键盘操作,用用就习惯了。 minicom的安装、配置可以参考这篇: ubuntu下的usb转串口的使用 。 来源: https://www

grep + grep + sed = sed: no input files

好久不见. 提交于 2020-01-14 19:32:26
问题 Can anybody help me please? grep " 287 " file.txt | grep "HI" | sed -i 's/HIS/HID/g' sed: no input files Tried also xargs grep " 287 " file.txt | grep HI | xargs sed -i 's/HIS/HID/g' sed: invalid option -- '6' This works fine grep " 287 " file.txt | grep HI 回答1: If you want to keep your pipeline: f=file.txt tmp=$(mktemp) grep " 287 " "$f" | grep "HI" | sed 's/HIS/HID/g' > "$tmp" && mv "$tmp" "$f" Or, simplify: sed -i -n '/ 287 / {/HI/ s/HIS/HID/p}' file.txt That will filter out any line that

grep + grep + sed = sed: no input files

无人久伴 提交于 2020-01-14 19:32:19
问题 Can anybody help me please? grep " 287 " file.txt | grep "HI" | sed -i 's/HIS/HID/g' sed: no input files Tried also xargs grep " 287 " file.txt | grep HI | xargs sed -i 's/HIS/HID/g' sed: invalid option -- '6' This works fine grep " 287 " file.txt | grep HI 回答1: If you want to keep your pipeline: f=file.txt tmp=$(mktemp) grep " 287 " "$f" | grep "HI" | sed 's/HIS/HID/g' > "$tmp" && mv "$tmp" "$f" Or, simplify: sed -i -n '/ 287 / {/HI/ s/HIS/HID/p}' file.txt That will filter out any line that

zabbix监控redis、tomcat、Nginx

我怕爱的太早我们不能终老 提交于 2020-01-14 15:54:21
本次博文需基于zabbix的基本环境,可参考 搭建zabbix 一、配置zabbix监控redis (1)部署zabbix agent端 部署agent端详细信息、下载软件包可参考博文 配置Zabbix监控之邮件报警、微信报警 这里就不进行详细解释了! [root@agent ~]# tar zxf zabbix-3.2.1.tar.gz && cd zabbix-3.2.1/ [root@agent zabbix-3.2.1]# ./configure --prefix=/usr/local/zabbix --enable-agent && make && make install [root@agent zabbix-3.2.1]# useradd zabbix [root@agent zabbix-3.2.1]# cp /root/zabbix-3.2.1/misc/init.d/fedora/core/zabbix_agentd /etc/init.d/ [root@agent zabbix-3.2.1]# sed -i "s#BASEDIR=/usr/local#BASEDIR=/usr/local/zabbix#g" /etc/init.d/zabbix_agentd [root@agent zabbix-3.2.1]# chmod +x /etc/init.d

R: enumerate column combinations of a matrix

て烟熏妆下的殇ゞ 提交于 2020-01-14 14:11:51
问题 (edit note: I changed the Title to "R: enumerate column combinations of a matrix", from "R grep: matching a matrix of strings to a list" to better reflect the solution) I am trying to match a matrix of strings to a list: so that i can ultimately use the matrix as a map in later operations on a data.frame . This first part works as intended, returning a list of all the possible pairs, triples and quad combinations (though perhaps this approach has created my bind?): priceList <- data.frame(aaa

R: enumerate column combinations of a matrix

眉间皱痕 提交于 2020-01-14 14:09:02
问题 (edit note: I changed the Title to "R: enumerate column combinations of a matrix", from "R grep: matching a matrix of strings to a list" to better reflect the solution) I am trying to match a matrix of strings to a list: so that i can ultimately use the matrix as a map in later operations on a data.frame . This first part works as intended, returning a list of all the possible pairs, triples and quad combinations (though perhaps this approach has created my bind?): priceList <- data.frame(aaa

R: enumerate column combinations of a matrix

夙愿已清 提交于 2020-01-14 14:07:22
问题 (edit note: I changed the Title to "R: enumerate column combinations of a matrix", from "R grep: matching a matrix of strings to a list" to better reflect the solution) I am trying to match a matrix of strings to a list: so that i can ultimately use the matrix as a map in later operations on a data.frame . This first part works as intended, returning a list of all the possible pairs, triples and quad combinations (though perhaps this approach has created my bind?): priceList <- data.frame(aaa

Grep ambiguity nested square bracket

℡╲_俬逩灬. 提交于 2020-01-14 12:58:20
问题 sample.txt contains abcde abde Can anybody explain the output of following commands - grep '[[ab]]' sample.txt - no output grep '[ab[]]' sample.txt - no output grep '[ab[]' sample.txt - output is abcde , abde grep '[ab]]' sample.txt - no output And what does [(ab)] and [^(ab)] mean? Is it the same as [ab] and [^ab] ? 回答1: First thing to understand is, inside a character class, none of the meta-characters of regex has any special meaning. They are matched literally. For e.g., an * will match a

Cucumber: pipe output without losing color

余生长醉 提交于 2020-01-14 10:08:34
问题 I'm using cucumber to run some tests. It colorizes its output using ANSI escapes. This is great, but currently its producing more output than I care about, and shoving things I do care about off the screen. There doesn't seem to be a way to eliminate the other lines from within cucumber, but I can pipe the output through grep to pare down to the ones I care about. The downside of this solution, though, is that all the colors are lost. I know it's not my shell or grep's fault, because % echo "