02 2021 档案

摘要:#####wc -l 统计行号 [root@rongbiz002 26]# wc -l /etc/passwd 30 /etc/passwd 阅读全文
posted @ 2021-02-27 13:44 老夫聊发少年狂88 阅读(60) 评论(0) 推荐(0) 编辑
摘要:工作模式 逐行读取 awk 'BEGIN{print "hello"} {print "ok"} END {print "word"}' /etc/passwd BEGIN 读取文件之前做的操作 print ok 逐行读取文件 每一行打印一个ok END 读取文件之后做的操作 1 查 1.1)打印整 阅读全文
posted @ 2021-02-27 11:48 老夫聊发少年狂88 阅读(80) 评论(0) 推荐(0) 编辑
摘要:######cut -d 指定分隔符 -f 指定列数 1,2,3 [root@rongbiz002 26]# awk '{print $1}' /www/wwwlogs/c2p.rongbiz.com-access_log|head -n5 |cut -d '.' -f 1,2,3 112.64.5 阅读全文
posted @ 2021-02-27 11:25 老夫聊发少年狂88 阅读(51) 评论(0) 推荐(0) 编辑
摘要:按照行模式处理数据 ####1查 #####1.1)打印单行信息 [root@iZbp130bctfwzi3oasr6raZ conf.d]# sed -n '1p' /etc/passwd root:x:0:0:root:/root:/bin/bash #####1.2)打印连续多行信息 1-3 阅读全文
posted @ 2021-02-27 11:16 老夫聊发少年狂88 阅读(46) 评论(0) 推荐(0) 编辑
摘要:uniq -c统计次数 [root@rongbiz002 26]# awk '{print $1}' /www/wwwlogs/c2p.rongbiz.com-access_log|sort |uniq -c|sort -k1rn|head 2709 112.64.53.246 2668 120.5 阅读全文
posted @ 2021-02-27 11:12 老夫聊发少年狂88 阅读(88) 评论(0) 推荐(0) 编辑
摘要:######sort -t 指定分隔符 -k 指定那一列排序 [root@rongbiz002 ~]# awk '{print $1}' /www/wwwlogs/www.rongbiz.com-access_log |sort -t "." -k2|head 120.0.113.75 112.0. 阅读全文
posted @ 2021-02-27 10:09 老夫聊发少年狂88 阅读(162) 评论(0) 推荐(0) 编辑
摘要:which command which ls alias ls='ls --color=auto' /usr/bin/ls 阅读全文
posted @ 2021-02-27 09:34 老夫聊发少年狂88 阅读(42) 评论(0) 推荐(0) 编辑
摘要:curl -o 下载到某个目录 并重命名 curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo 阅读全文
posted @ 2021-02-27 09:03 老夫聊发少年狂88 阅读(53) 评论(0) 推荐(0) 编辑
摘要:下载软件 wget wget -O 把文件下载到某个目录 并重命名 wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo wget --limit-rate=100k 阅读全文
posted @ 2021-02-27 09:01 老夫聊发少年狂88 阅读(49) 评论(0) 推荐(0) 编辑
摘要:#####根据内容过滤文本信息 #####grep [root@rstx-201 ~]# grep root /etc/passwd root:x:0:0:root:/root:/bin/bash operator:x:11:0:operator:/root:/sbin/nologin 加上通配符^ 阅读全文
posted @ 2021-02-26 14:48 老夫聊发少年狂88 阅读(148) 评论(0) 推荐(0) 编辑
摘要:######tail 查看文件的尾部信息 默认后10行 [root@rstx-53 test]# tail /etc/passwd openvpn:x:995:991:OpenVPN:/etc/openvpn:/sbin/nologin postgres:x:26:26:PostgreSQL Ser 阅读全文
posted @ 2021-02-26 14:40 老夫聊发少年狂88 阅读(46) 评论(0) 推荐(0) 编辑
摘要:#####head 查看文件头部内容 默认前十行 [root@rstx-201 ~]# head /etc/passwd root:x:0:0:root:/root:/bin/bash bin:x:1:1:bin:/bin:/sbin/nologin daemon:x:2:2:daemon:/sbi 阅读全文
posted @ 2021-02-26 14:26 老夫聊发少年狂88 阅读(28) 评论(0) 推荐(0) 编辑
摘要:######cat #查看文件内容 [root@rstx-53 test]# cat /etc/passwd root:x:0:0:root:/root:/bin/bash bin:x:1:1:bin:/bin:/sbin/nologin daemon:x:2:2:daemon:/sbin:/sbi 阅读全文
posted @ 2021-02-26 14:17 老夫聊发少年狂88 阅读(58) 评论(0) 推荐(0) 编辑
摘要:rm 删除 remove #####绕过交互删除 -f [root@rstx-53 test]# rm file rm: remove regular empty file ‘file’? n [root@rstx-53 test]# fm -f file -bash: fm: command no 阅读全文
posted @ 2021-02-26 14:09 老夫聊发少年狂88 阅读(46) 评论(0) 推荐(0) 编辑
摘要:移动文件和目录 ######改名 [root@rstx-53 test]# mv file.txt /tmp/file_txt [root@rstx-53 test]# ls [root@rstx-53 test]# ll /tmp/file_txt -rw-r--r-- 1 yangtao yan 阅读全文
posted @ 2021-02-26 13:47 老夫聊发少年狂88 阅读(80) 评论(0) 推荐(0) 编辑
摘要:cp 复制 copy ######复制文件 -v显示过程 [root@rstx-53 test]# touch file.txt [root@rstx-53 test]# cp file.txt /tmp/file_copy [root@rstx-53 test]# ll /tmp/file_cop 阅读全文
posted @ 2021-02-26 13:35 老夫聊发少年狂88 阅读(54) 评论(0) 推荐(0) 编辑
摘要:#####以树状的结构显示目录和文件 [root@rstx-201 ~]# tree . ├── anaconda-ks.cfg ├── test └── test2 ├── 1 └── 2 4 directories, 1 file #显示文件和目录的数量 ######tail -L 查看目录层数 阅读全文
posted @ 2021-02-26 13:12 老夫聊发少年狂88 阅读(79) 评论(0) 推荐(0) 编辑
摘要:#####mkdir make directory 选项 -v 显示创建详情 -p 递归创建 [root@rstx-201 ~]# mkdir test/test/test -vp mkdir: created directory ‘test’ mkdir: created directory ‘t 阅读全文
posted @ 2021-02-26 11:48 老夫聊发少年狂88 阅读(45) 评论(0) 推荐(0) 编辑
摘要:#####touch 创建文件 ######touch file 无则创建 有责修改创建时间 [root@rstx-201 ~]# touch file [root@rstx-201 ~]# ll -rw-r--r-- 1 root root 0 Feb 25 22:28 file [root@rs 阅读全文
posted @ 2021-02-26 11:40 老夫聊发少年狂88 阅读(48) 评论(0) 推荐(0) 编辑
摘要:cd 回到家目录 cd ~ 回到家目录 cd . 回到当前目录 cd .. 回到上级目录 cd - 回到上一次所在的目录 阅读全文
posted @ 2021-02-26 11:25 老夫聊发少年狂88 阅读(50) 评论(0) 推荐(0) 编辑
摘要:#####1 . ..代表什么 . 代表当前目录 .. 代表上级目录 #####从根/开始的路径是'绝对路径' [root@rongbiz002 ~]# cd /etc/skel/ #####从当前位置开始的目录为'相对路径' [root@rongbiz002 /]# cd etc/skel/ 阅读全文
posted @ 2021-02-26 11:09 老夫聊发少年狂88 阅读(52) 评论(0) 推荐(0) 编辑
摘要:通过bash shell对文件进行管理 就是 增 删 改 查 系统目录结构 几乎所有的操作系统都会通过目录结构来组织文件 具体来说就是一个目录里面存放子目录及文件 成树状 ######bin目录 普通用户的执行的命令 [root@rstx-53 /]# which ls /usr/bin/ls ## 阅读全文
posted @ 2021-02-25 15:24 老夫聊发少年狂88 阅读(68) 评论(0) 推荐(0) 编辑
摘要:#####1 命令补全 ps: tab键可以实现命令还有参数及路径补全 加快命令输入速度 还有减少路径输入错误带来的麻烦 安装tab补全工具 yum install bash-completion Loaded plugins: fastestmirror Loading mirror speeds 阅读全文
posted @ 2021-02-25 14:57 老夫聊发少年狂88 阅读(75) 评论(0) 推荐(0) 编辑
摘要:whoami [root@rstx-53 ~]# whoami root #####创建用户 useradd [root@rstx-53 ~]# useradd yangtao useradd yangtao [root@rstx-53 ~]# passwd yangtao passwd yangt 阅读全文
posted @ 2021-02-25 11:50 老夫聊发少年狂88 阅读(65) 评论(0) 推荐(0) 编辑
摘要:####bash 命令解释器 它在操作系统的最外层 操作系统的一个壳 命令解释器 通过bash驱动程序 程序驱动内核 内核驱动硬件 让计算机工作 可以执行脚本 [root@rstx-53 ~]# for i in {1..100} ; do echo yang${i} ;done for i in 阅读全文
posted @ 2021-02-25 10:59 老夫聊发少年狂88 阅读(343) 评论(0) 推荐(0) 编辑
摘要:#####HTTP协议是什么 由w3c制定的一种网络应用层协议,定义了浏览器与web服务器之间通信时所使用的数据格式。 通信过程 1.浏览器建立与web服务器之间的连接 2.浏览器将请求数据打包(生成请求数据包)并发送到web服务器 Request(请求) 3.web服务器将处理结果打包(生成响应数 阅读全文
posted @ 2021-02-05 18:40 老夫聊发少年狂88 阅读(135) 评论(0) 推荐(0) 编辑
摘要:POC、EXP、Payload与Shellcode webshell POC:全称 ' Proof of Concept ',中文 ' 概念验证 ' ,常指一段漏洞证明的代码。 证明代码是否有漏洞 EXP:全称 ' Exploit ',中文 ' 利用 ',指利用系统漏洞进行攻击的动作。 利用漏洞代码 阅读全文
posted @ 2021-02-05 18:24 老夫聊发少年狂88 阅读(92) 评论(0) 推荐(0) 编辑