Saturday, December 23, 2017

grub2 - How to list GRUB's "menuentries" in command-line?



Is there a way of retrieving list of "menuentries" titles of GRUB?



I need a results in a format that grub-set-default will accept. eg.



"Ubuntu"
"Memory test (memtest86+)"
etc.



Using awk



awk -F\' '/menuentry / {print $2}' /boot/grub/grub.cfg 


gives you a full list of all menu entries in grub.cfg.


No comments:

Post a Comment

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...