zhangkai 发表于 2022-8-2 16:20:07

18天作业

利sed 取出ifconfIg ens33命令中本机的IPv4地址可以百度扩展了解即可

把/etc/passwd 复制到/root/test.txt,用sed打印所有行

打印test.txt的3到10行

打印test.txt 中包含 ‘root’ 的行

删除test.txt 的15行以及以后所有行

删除test.txt中包含 ‘bash’ 的行


替换test.txt 中 ‘root’ 为 ‘ha’

替换test.txt中 ‘/sbin/nologin’ 为 ‘/bin/login’


打印/etc/passwd的奇数行?sed -n 'p;n' file 打印奇数行 sed -n 'n;p' file 打印偶数行


把/etc/httpd/conf/httpd.conf?件内的Linsten 80改为Listen 8081sed 完成



页: [1]
查看完整版本: 18天作业