Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要知道如何使用 sed 删除 grub.cfg 中的条目在我的情况下,我想删除 sda3 上的 Windows 10 条目,这是一个多行条目
谢谢
我找到了这个解决方案:
sed -i "/menuentry 'Windows 10 (on \/dev\/sda3/,/}/d" grub.cfg
要删除的 INI 菜单项->menuentry 'Windows 10 (on \/dev\/sda3
menuentry 'Windows 10 (on \/dev\/sda3
END 要删除的菜单项->}
}
我将它"与 sed 一起使用,因为'它是条目的一部分
"
'