0

I am trying to set GRUB to not show at startup by using the command line. For this I try editing /etc/default/grub with sudo, but I get a Permission denied error as a response:

myuser@mysystem:~$ sudo echo "GRUB_HIDDEN_TIMEOUT_QUIET=true" >> /etc/default/grub
bash: /etc/default/grub: Permission denied

What I want to set:

sudo echo "" >> /etc/default/grub
sudo echo "# Hide Grub" >> /etc/default/grub
sudo echo "GRUB_HIDDEN_TIMEOUT=0" >> /etc/default/grub
sudo echo "GRUB_HIDDEN_TIMEOUT_QUIET=true" >> /etc/default/grub
sudo update-grub

Permissions of the file:

myuser@mysystem:~$ ll /etc/default/grub
-rw-r--r-- 1 root root 1211 Feb 12 20:00 /etc/default/grub

Shouldn't I be able to use sudo to edit this file? Why doesn't sudo give me the permission even though the file belongs to root:root?

EDIT:

Found out that the two above GRUB settings do not work for the desired goal. To still achieve GRUB not showing the following setting needs to be added to /etc/default/grub using:

sudo bash -c "echo 'GRUB_DISABLE_OS_PROBER=true' >> /etc/default/grub"
Zanna
  • 72,312
Socrates
  • 2,645

0 Answers0