Update grub menu.lst

sed -e '/^$/d' -e '/^#/d' -e '/initrd/ a\ ' -e 's/hiddenmenu//g' -e '/^timeout/d' -e '/default/ a\timeout\t\t15' -e 's/quiet//g' -e 's/splash/rootdelay=60/g' /boot/grub/menu.lst > /boot/grub/menu.lst.new
Remove all commented lines Remove all blank lines Show the menu Up the delay so you have enough time to select a kernel Remove the quiet so you can watch the entire boot Add a rootdelay for san attached storage booting
Sample Output
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

1
By: z0rk
2011-06-28 08:03:17
sed

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: