Dual boot Windows 10 & Ubuntu 18.04 - How to tell grub not to show and boot directly to Windows 10 [duplicate]

I am dual booting Windows 10 and Ubuntu 18.04. How to tell grub not to show the boot menu and boot directly to Windows 10 by default? What should I do if I want to boot to Ubuntu 18.04 instead of the default Windows 10?


The file /etc/default/grub contains a line:

GRUB_TIMEOUT=10 

edit the file and make the 10 to 0 to hide the grub menu. You may force the grub menu by holding down a key, shift or tab.

Making Windows the default may be done by renaming the file
/etc/grub.d/30_os-prober to /etc/grub.d/06_os-prober, so it gets run before the 10_linux file.

sudo mv /etc/grub.d/30_os-prober /etc/grub.d/06_os-prober  

In the 30_os-prober file, change the quick_boot=1 to quick_boot=0 to keep the timeout value from being reset in certain cases.