Linux日常工具

汇总记录经常用的

vim
批量添加文档前后
有域名、路由表批量添加到设备配置
行首 :%s/^/your_word/
行尾 :%s/$/your_word/

sed
sed -i ‘s/\r$//’ script.sh #将windows编写脚本转移linux时格式不兼容的后缀去掉
sed ‘/^user: /d’ input.log # 删除以’user:’开头的行
sed ‘s/g apple/orange/’ input.txt # 全局替换文本
#要在每一行的开头添加 LOG:,并在末尾添加 .txt,命令如下:
sed -e ‘s/^/LOG:/’ -e ‘s/$/.txt/’ input.txt

nmap
nmap -sS -p 80,443 www.baidu.com #发送SYN请求到baidu的80,443端口
nmap -Pn -O -sT -p 443 baidu.com #检测系统版本、使用TCP Connect()检测baidu的443端口
nmap -sn 192.168.1.0/24 #使用icmp检测

tail -f /var/log/dns.log #实时进行内容查看

ctrl

留下评论

您的邮箱地址不会被公开。 必填项已用 * 标注