首页 > 系统服务 > 详细

LINUX--软件包管理&sed

时间:2021-04-18 11:27:33      阅读:18      评论:0      收藏:0      [点我收藏+]

1、自建yum仓库,分别为网络源和本地源
待更新
2、编译安装http2.4,实现可以正常访问,并将编译步骤和结果提交。

wget https://mirrors.bfsu.edu.cn/apache//httpd/httpd-2.4.46.tar.bz2
tar xvf httpd-2.4.46.tar.bz2 -C /usr/local/src
cd /usr/local/src/httpd-2.4.46/
./configure --prefix=/apps/httpd24 --sysconfdir=/etc/httpd24 --enable--ssl
make -j 3 && make install
apachectl

技术分享图片
技术分享图片

3、利用sed 取出ifconfig命令中本机的IPv4地址

lime@ubuntu1804:~$ ifconfig ens33 | sed -nr "2s/[^0-9]+([0-9.]+).*/\1/p" 
10.0.0.203 

4、删除/etc/fstab文件中所有以#开头,后面至少跟一个空白字符的行的行首的#和空白字符

可能是错的,还在想答案ing
lime@ubuntu1804:~$ sed -n ‘/^#/s/ //p‘  /etc/fstab  
#/etc/fstab: static file system information. 
#Use ‘blkid‘ to print the universally unique identifier for a 
#device; this may be used with UUID= as a more robust way to name devices 
#that works even if disks are added and removed. See fstab(5). 
#<file system> <mount point>   <type>  <options>       <dump>  <pass> 
#/ was on /dev/sda1 during installation 
#/boot was on /dev/sda2 during installation 
#/data was on /dev/sda3 during installation 
#swap was on /dev/sda4 during installation 

5、处理/etc/fstab路径,使用sed命令取出其目录名和基名

lime@ubuntu1804:~$ echo "/etc/fstab/" | sed -r ‘s#(^/./)([^/]+/?)#\2#‘
fstab/
lime@ubuntu1804:~$ echo "/etc/fstab/" | sed -r ‘s#(^/./)([^/]+/?)#\1#‘
/etc/

LINUX--软件包管理&sed

原文:https://www.cnblogs.com/limeliu/p/14672707.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!