处理/etc/fstab路径,使用sed命令取出其目录名和基名
[16:49:31 root@centos8 ~]#ls /etc/fstab |sed -r 's#^(/.*/)(.*)#path: \1 \nbasename: \2#'
path: /etc/
basename: fstab
[16:49:31 root@centos8 ~]#ls /etc/fstab |sed -r 's#^(/.*/)(.*)#path: \1 \nbasename: \2#'
path: /etc/
basename: fstab