当前位置:网站首页>shell-第八章练习
shell-第八章练习
2022-07-25 10:28:00 【weixin_51808099】
1、删除/etc/grub2.conf文件中所有以空白开头的行行首的空白字符
[[email protected] zuoye]# sed 's/^ *//' /etc/grub2.cfg
2、删除/etc/fstab文件中所有以#开头,后面至少跟一个空白字符的行的行首的#和空白字符
[[email protected] zuoye]# sed -r 's/^# +//' /etc/fstab
3、在/root/install.log每一行行首增加#号
[[email protected] zuoye]# sed 's/^./#&/' hostip
4、在/etc/fstab文件中不以#开头的行的行首增加#号
[[email protected] zuoye]# sed 's/^[^#]/#&/' /etc/fstab
5、利用sed 取出ifconfig命令中本机的IPv4地址
[[email protected] zuoye]# ifconfig |grep ens224 -1|sed -n 3p| sed -r "s/.*inet[[:space:]]*//" | sed -r "s/[[:space:]]*netmask.*//"
6、关闭本机SELinux的功能
[[email protected] zuoye]# sed 's/^SELINUX=.*/SELINUX=permissive/' /etc/selinux/config
7、在/etc/hosts配置文件中添加内容
[[email protected] zuoye]# sed '1 a\sy' /etc/passwd
边栏推荐
- 我,AI博士生,在线众筹研究主题
- Druid 查询超时配置的探究 → DataSource 和 JdbcTemplate 的 queryTimeout 到底谁生效?
- DICOM medical image viewing and browsing function based on cornerstone.js
- Flask框架——flask-caching缓存
- BGP federal experiment
- JS bidirectional linked list 02
- From the perspective of open source, analyze the architecture design of SAP classic ERP that will not change in 30 years
- Reinforcement learning (III)
- Understand the life cycle and route jump of small programs
- Learn NLP with Transformer (Chapter 7)
猜你喜欢

Learn NLP with Transformer (Chapter 1)
Learn NLP with Transformer (Chapter 2)

MySQL master-slave replication and read-write separation

Esp8266 uses drv8833 drive board to drive N20 motor

HCIP (01)

A troubleshooting record of DirectShow playback problems

Esp32c3 based on the example tutorial of esp32 Rainmaker development under Arduino framework

Flask framework - session and cookies

HCIA experiment (10) nat

The most detailed MySQL index analysis (mind map is attached at the end of the article)
随机推荐
tensorflow入门
tensorflow 调用多块GPU的一些错误
Learn NLP with Transformer (Chapter 2)
游戏背包系统,“Inventory Pro插件”,研究学习-----妈妈再也不用担心我不会做背包了(Unity3D)
Hcip experiment (03)
Learning Weekly - total issue 63 - an open source local code snippet management tool
机智云物联网平台 STM32 ESP8266-01S 简单无线控灯
Learn NLP with Transformer (Chapter 5)
Probe into Druid query timeout configuration → who is the querytimeout of datasource and jdbctemplate effective?
Redis sentry, high availability executor
Druid 查询超时配置的探究 → DataSource 和 JdbcTemplate 的 queryTimeout 到底谁生效?
Esp8266 uses drv8833 drive board to drive N20 motor
30000 word express Servlet
数字孪生万物可视 | 联接现实世界与数字空间
Learn NLP with Transformer (Chapter 2)
ESP8266 使用 DRV8833驱动板驱动N20电机
我,AI博士生,在线众筹研究主题
HCIA experiment (08)
学习路之PHP--Phpstudy 提示 Mysqld.Exe: Error While Setting Value ‘NO_ENGINE_SUBSTITUTION 错误的解决办法
Visual thematic map of American airport go style: ArcGIS Pro version