WK6
-
自建yum仓库,分别为网络源和本地源
https://www.jianshu.com/p/07991a58aeab
-
编译安装http2.4,实现可以正常访问,并将编译步骤和结果提交。
#安装依赖 [root@centos8 ~]# dnf install gcc make apr-devel apr-util-devel pcre-devel openssl-devel redhat-rpm-config #下载httpd压缩包文件到本地,并解压缩 [root@centos8 local]# tar -xf httpd-2.4.46.tar.bz2 #配置 [root@centos8 httpd-2.4.46]# ./configure #编译 [root@centos8 httpd-2.4.46]# make #安装 [root@centos8 httpd-2.4.46]# make install #配置环境变量 [root@centos8 bin]# echo 'PATH=/usr/local/apache2/bin:$PATH' > /etc/profile.d/httpd24.sh [root@centos8 bin]# . /etc/profile.d/httpd24.sh #开启httpd [root@centos8 conf]# apachectl
-
利用sed 取出ifconfig命令中本机的IPv4地址
[root@centos8 ~]# ifconfig ens33|sed -rn '2s/^[^0-9]+([0-9.]+).*$/\1/p' 10.172.112.228
-
删除/etc/fstab文件中所有以#开头,后面至少跟一个空白字符的行的行首的#和空白字符
[root@centos8 data]# sed -En 's/^# (.*)/\1/p' /data/fstab /etc/fstab Created by anaconda on Sat Jan 2 01:32:26 2021 Accessible filesystems, by reference, are maintained under '/dev/disk/'. See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info. After editing this file, run 'systemctl daemon-reload' to update systemd units generated from this file.
-
处理/etc/fstab路径,使用sed命令取出其目录名和基名
#取目录 [root@centos8 ~]# echo /etc/fstab |sed -rn 's#(^/.*/)([^/]+)#\1#p' /etc/ #取基名 [root@centos8 ~]# echo /etc/fstab |sed -rn 's#(^/.*/)([^/]+)#\2#p' fstab