2 回答
TA贡献1784条经验 获得超9个赞
使用唯一路径列表更容易,因此请从删除其他所有行开始:
:g/^/+d
(摘自此答案)
然后,将每一行替换为所需的命令:
:%s/.*/chown user:user &\rchmod 755 &/
:% run this command on the entire buffer:
s replace
/.*/ an entire line with
chown user:user (literal "chown user:user ")
& the entirety of the match
\r newline
chmod 755 (literal "chmod 755 ")
& the entirety of the match again
/ (end the regex)
(&并\r记录在中:help sub-replace-special。)
- 2 回答
- 0 关注
- 388 浏览
添加回答
举报