当前位置:网站首页>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
边栏推荐
- 2022 / 7 / 16 exam summary
- 2022-07-08 group 5 Gu Xiangquan's learning notes day01
- The difference between LinkedList and ArrayList
- The difference between abstract classes and interfaces
- C# WinForm中PreviewKeyDown、KeyDown、KeyPress、KeyUp区别与联系
- C# 获取选择文件信息
- Common Oracle functions
- Summary of distributed related interview questions
- CentOS install mysql5.7
- 《门锁》引爆独居安全热议 全新海报画面令人窒息
猜你喜欢

Burp suite Chapter 5 how to use burp target

Use js to count the number of occurrences of each string in the string array, and format it into an object array.

分布式相关面试题总结

一点一点理解微服务

一文掌握mysql数据库审计特点、实现方案及审计插件部署教程

Traversal mode of list, set, map, queue, deque, stack

99 multiplication table and inverted triangle 99 multiplication table

Excel file parsing

Lnmp+wordpress to quickly build a personal website

2022-07-09 group 5 Gu Xiangquan's learning notes day02
随机推荐
Common database commands (special for review)
我,35岁了。
2022-07-14 group 5 Gu Xiangquan's learning notes day07
基础乐理 节奏联系题,很重要
外卖小哥,才是这个社会最大的托底
The most complete network: detailed explanation of six constraints of MySQL
How to determine the authenticity of the website you visit -- certificate system
这是一张图片
2022/7/6 exam summary
The first ide overlord in the universe, replaced...
C # get the information of the selected file
"Door lock" ignites a heated discussion on the safety of living alone. The new poster picture is suffocating
Unity Metaverse(二)、Mixamo & Animator 混合树与动画融合
Abstract classes and interfaces
The difference between overloading and rewriting
Summary of distributed related interview questions
Burp Suite - Chapter 1 burp suite installation and environment configuration
ORACLE 官方文档
The difference between equals() and = =
[xshell7 free download and installation]