使用sed更新grub menu.lst

・1 分钟阅读

更新grub menu.lst

sed -e '/^$/d' -e '/^#/d' -e '/initrd/ a ' -e 's/hiddenmenu//g' -e '/^timeout/d' -e '/default/ atimeouttt15' -e 's/quiet//g' -e 's/splash/rootdelay=60/g' /boot/grub/menu.lst > /boot/grub/menu.lst.new
示例输出
default 0
timeout 15
title Ubuntu 10.04.2 LTS, kernel 2.6.38-8-server
uuid 4f51a5a9-0604-4929-aace-29ed958b4fdb
kernel /vmlinuz-2.6.38-8-server root=UUID=5589518c-5635-49c5-9719-e89e1ada300b ro rootdelay=60
initrd /initrd.img-2.6.38-8-server
title Ubuntu 10.04.2 LTS, kernel 2.6.38-8-server (recovery mode)
uuid 4f51a5a9-0604-4929-aace-29ed958b4fdb
kernel /vmlinuz-2.6.38-8-server root=UUID=5589518c-5635-49c5-9719-e89e1ada300b ro single
initrd /initrd.img-2.6.38-8-server
讨论
Hujiuxiang profile image