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

echo /etc/fstab | sed -nr 's#(^\/.*)\/(.*)#\1#p'

echo /etc/fstab | sed -nr 's#(^\/.*)\/(.*)#\2#p'

 

posted @ 2022-03-24 20:00  海月如希  阅读(55)  评论(0)    收藏  举报