Bash编程CV工程师指南

  |   0 评论   |   1,130 浏览

判断操作系统类型

链接:

代码:

进行HTTP 8080 端口抓包

引用: https://www.cnblogs.com/luihengk/p/6840795.html

tcpdump -i eth1 -s 0 -l -w - dst port 8080 | strings


# 抓 8080 GET

sudo tcpdump -i eth0  'tcp[(tcp[12]>>2):4] = 0x47455420' |strings

xargs 相关参数

  • -t: 执行之前把命令输出到标准错误输出. (方便查看)
  • -I: 指定占位符号. 如:-I {}
  • -n1: 指定每次最大的执行参数个数. 比如这里限定为1个.
ls -1 | xargs -n1 -t -I grep "keywords" {}

单引号包含单引号

使用单引号字符串和双引号字符串交替拼接.

echo 'I'"'"'m a student'

实际上是:

image.png

直接转义单引号:

echo 'I\'m a student'

这样是行不通的. 但是下面这样可以:

echo $'I\'m a student'

最简洁的有单引号字符串拼接

这可能是最简洁的写法.

echo 'I'\''m a student'

image.png

参考:
https://stackoverflow.com/questions/8254120/how-to-escape-a-single-quote-in-single-quote-string-in-bash

评论

发表评论


取消