I'm trying to change my directory to /boot/efi, but running sudo cd /boot/efi
does nothing. I'm on fedora 23. Is there a more powerful command for this?
2 Answers
cd
is a shell builtin, and sudo
only works with programs.
Try using either su -
or sudo -i
before changing directory. These will elevate your login session to that of the root user. Once finished making changes, make sure to type exit
to return to being a normal user.
-
That works, thanks, but there's a file in there, grub.cfg, and i'm trying to copy it to my home folder, which works after doing sudo -i and using the cp command, however i don't have permission to open that file (it does work with sudo vim, but how do i change permissions on that file?) Jul 4, 2016 at 20:31
-
-
Can i also keep root as the owner but add me as readwrite permissions? Jul 4, 2016 at 20:37
-
-
Cool, that works! I also looked it up and you can also do:
sudo chown :frederik grub.cfg
to change the group Andsudo chmod g+r grub.cfg
to give that group read permission Thanks a lot!sudo chmod 640 grub.cfg
also works for changing the permissions (in this case rw for root and r for group, none for others. Jul 4, 2016 at 20:50
You can do this to cd as super user:
sudo -s
cd directory