当前位置:网站首页>sed作业
sed作业
2022-07-26 08:12:00 【三俩两】
1、删除/etc/grub2.conf文件中所有以空白开头的行行首的空白字符
sed 's/^[[:space:]]//' /etc/grub2.conf
2、删除/etc/fstab文件中所有以#开头,后面至少跟一个空白字符的行的行首的#和空白字符
sed 's/^#[[:space:]]*//g' /etc/fstab
3、在/root/install.log每一行行首增加#号
sed 's/^.*$/#&/' /root/install.log
4、在/etc/fstab文件中不以#开头的行的行首增加#号
sed 's/^[^#]/#&/' /root/install.log
5、利用sed 取出ifconfig命令中本机的IPv4地址
ifconfig | sed -n 2p | sed -r "s/.*inet[[:space:]]*//" | sed -r "s/[[:space:]]*netmask.*//"
6、关闭本机SELinux的功能
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
7、在/etc/hosts配置文件中添加内容
sed -i '1 i hhhh' hosts
sed -i '$ a heihei ' hosts
边栏推荐
- [June 29, 2022] examination summary
- Table fix specific rows
- Why is Google's internal tools not suitable for you?
- 一点一点理解微服务
- [fastjson1.2.24 deserialization vulnerability principle code analysis]
- IDEA settings设置快捷键实现字符串中的英文字母转大小写
- 小组成员参加2022中国多媒体大会
- 2022 7/5 exam summary
- Exam summary on July 15, 2022
- Matlab drawing black spots on two / three-dimensional drawings
猜你喜欢

Burp Suite-第八章 如何使用Burp Intruder

Shardingjdbc pit record

小组成员参加2022中国多媒体大会

The first ide overlord in the universe, replaced...

IDEA settings设置快捷键实现字符串中的英文字母转大小写

Web side 3D visualization engine hoops communicator reads 10g super large model test | digital twin Technology

The bigger the project is, the bigger it is. This is how I split it

JSP built-in object (implicit object) -- input / output object

2022-07-13 group 5 Gu Xiangquan's learning notes day06

Burp suite Chapter 4 advanced options for SSL and proxy
随机推荐
Read and write of zip file
宇宙第一 IDE 霸主,换人了。。。
咱就是来聊聊并发编程的三大核心问题。
数组的介绍--Array
【 fastjson1.2.24反序列化漏洞原理代码分析】
Burp Suite-第一章 Burp Suite 安装和环境配置
一文掌握mysql数据库审计特点、实现方案及审计插件部署教程
The difference between FileInputStream and bufferedinputstream
Spotty music data client_ ID account
这是一张图片
我,35岁了。
A clear summary and configuration example of GPON has been highlighted
Enterprise private network construction and operation and maintenance
The bigger the project is, the bigger it is. This is how I split it
AQS implementation principle
Rack server expansion memory
File parsing (JSON parsing)
Burp Suite - Chapter 2 burp suite proxy and browser settings
Burp suite Chapter 5 how to use burp target
Stack simulation queue