当前位置:网站首页>RHCSA第三天
RHCSA第三天
2022-08-02 03:16:00 【m0_54803732】
如有错误,敬请谅解!
此文章仅为本人学习笔记,仅供参考,如有冒犯,请联系作者删除!!!
1文件内容查看
(1)查看/etc/passwd文件的第6行
(2)查看/etc/selinux/config以SELINUX开头的行(3)查找/etc/ssh/sshd-config以no结尾的行
(4)过滤/etc/ssh/sshd config包含数字的行
2 文本处理
查看/etc/passwd文件以":"为分隔符的第一列内容,并按字母逆序排序写入/username文 件统计/etc/passwd文件一共有几行,只把行数显示。
3、统计系统执行频率最高的前十个命令
1.(1)查看/etc/passwd文件的第6行
[[email protected] ~]# head -6 /etc/passwd | tail -1
sync:x:5:0:sync:/sbin:/bin/sync
1. (2)查看/etc/selinux/config以SELINUX开头的行
[[email protected] ~]# grep ^[SELINUX] /etc/selinux/config
SELINUX=enforcing
SELINUXTYPE=targeted
1.(3)查找/etc/ssh/sshdconfig以no结尾的行
[[email protected] ~]# grep 'no'$ /etc/ssh/sshd_config
#HostbasedAuthentication no
#IgnoreUserKnownHosts no
#PermitEmptyPasswords no
ChallengeResponseAuthentication no
#KerberosAuthentication no
#KerberosGetAFSToken no
GSSAPICleanupCredentials no
#GSSAPIKeyExchange no
#GSSAPIEnablek5users no
#GatewayPorts no
PrintMotd no
#PermitUserEnvironment no
#UseDNS no
#PermitTunnel no
# X11Forwarding no
# AllowTcpForwarding no
# PermitTTY no
1.(4)过滤/etc/ssh/sshd config包含数字的行
[[email protected] ~]# grep ^[^0-9] /etc/ssh/sshd_config2、 文本处理
查看/etc/passwd文件以":"为分隔符的第一列内容,并按字母逆序排序写入/username文件
[[email protected] ~]# cut -d : -f 1 /etc/passwd | sort -r >/username统计/etc/passwd文件一共有几行,只把行数显示。
[[email protected] ~]# wc -l /etc/passwd
46 /etc/passwd3、统计系统执行频率最高的前十个命令
[[email protected] ~]# history | tr -s " " | cut -d " " -f3 | sort -n | uniq -c | sort -nr | head -10
42 ll
27 cat
20 cd
15 date
10 grep
9 timedatectl
9 ln
8 mkdir
8 ls
7 touch
知识点总结:
echo 标准输入输出命令(打印命令)
$变量名 > >>
| 管道符 (前面命令输出结果通过管道连接通过后面命令进行处理—字符)
| tee (横向输出重定向到指定文件。总想输出显示到终端)
vim三种模式常见命令
cat 内容较少
tac
more 内容多
less 内容多 打开阅读方式 vim
head 快速查看文件前几行
tail 快速查看文件后几行 默认十行
grep 过滤显示查看 用法: 关键字 文件名
-i 忽略大小写
-o 只显示匹配字
-v 反向过滤
-c 关键字的行数信息
-n 关键字行号
-w基于单词过滤(默认字符串)
^
$
^$ 过滤空白行
[ ]
cut 文本剪切命令
cut -c 1-3+文件名 按行提取
-b 按字节剪切
-d 指定分隔符类型
-f 来设置需要看的列数
sort 用于对文本内容进行排序显示
语法为: sort [选项] 文件名称
-n 按照数值排序 升序
-r 降序(从大到小)
-t 指定分隔符
-k 设置字符范围(列)
-u 去除重复行
uniq 用于去除文本中连续的重复行
语法为: uniq [选项] 文件名称
-c 文件名 重复次序统计
-D/-d 现实重复行(全部展开)
wc 用于统计指定文本文件的行数、字数或字节数
语法为: wc [选项] 文件名称
-l 只显示行数
-w 只显示单词数
-c 只显示字节数
-m 统计字符
-L 统计最长一行的字符数
tr 替换或者删除
-c 反选设定字符。也就是符合 SET1 的部份不做处理,不符合的剩余部份才进行转换
-d 删除指令字符
-s 缩减连续重复的字符成指定的单个字符
cp 复制文件或目录
语法: cp [选项] 源文件 目标文件
-r 复制目录文件
-p 保持文件原属性
-a ==-rp
mv 用于剪切或重命名文件
语法为: mv [选项] 源文件名称 目标文件名称
边栏推荐
- Foundry教程:使用多种方式编写可升级的智能代理合约(下)
- WebShell特征值汇总与检测工具
- Lua安装及常用命令使用
- 2022.7.30 js笔记 运算符和流程控制符、循环
- WebShell connection tools (Chinese kitchen knife, WeBaCoo, Weevely) use
- ASP WebShell backdoor script and anti-kill
- [Remote Control Development Basic Tutorial 3] Crazy Shell Open Source Formation UAV-ADC (Joystick Control)
- 7-43 字符串关键字的散列映射 (25 分) 谜之测试点
- ModuleNotFoundError: No module named ‘openpyxl‘
- 5.nodejs--cross domain, CORS, JSONP, Proxy
猜你喜欢

5.合宙Air32F103_LCD_key

JSP WebSehll backdoor script

"Paid paddling" stealthily brushes Brother Ali's face scriptures, challenges bytes three times, and finally achieves positive results

WebShell特征值汇总与检测工具

(Reposted) The relationship between hashcode and equals

ModuleNotFoundError: No module named ‘openpyxl‘

利用WebShell拿Shell技巧
![CV-Model [4]: MobileNet v3](/img/a1/fc3901d55b28aa080235f093b94cb4.png)
CV-Model [4]: MobileNet v3

暴力破解全攻略

iVX低代码平台系列详解 -- 概述篇(二)
随机推荐
mysql8.0.28下载和安装详细教程,适配win11
【LeetCode】206. Reverse linked list
利用WebShell拿Shell技巧
Ribbon本地实现负载均衡
Heao Technology Network Interview (with reference answers)
Day34 LeetCode
"Paid paddling" stealthily brushes Brother Ali's face scriptures, challenges bytes three times, and finally achieves positive results
OD-Model [4]: SSD
Good Key, Bad Key (thinking, temporary exchange, classic method)
JSP WebSehll backdoor script
MySQL8 - use under Windows package installation method
DOM destruction and reproduction experiment
LeetCode:1374. 生成每种字符都是奇数个的字符串【签到题】
支付通道对接常见的问题有哪些?
Keil development environment installation tutorial
MySQL8.0.26 installation and configuration tutorial (windows 64-bit)
基于优化的多核局部费舍尔判别分析的故障分类
小程序(开发必备常识)1
MongoDB文档存储
7-35 城市间紧急救援 (25 分)c语言(测试点二未通过)
