How to open terminal always with sudo privileges

I am wondering is there anyway to open terminal always with sudo privileges. And is there a way to open specific file with sudo privileges like windows have "run as administrator".


Solution 1:

To always open a terminal as root is not a good idea, but, hey, it is your computer and we hope you will act responsibly.

Edit your .bashrc file and add sudo -i to the end. Then, anytime you launch the terminal, it will always start with the prompt for the [sudo] password, and drop you to a prompt with root privileges when you successfully entered the password.

With respect to opening a specific file, there is an extension for the file manager Files (aka nautilus) that allows to open a new file manager window, or edit a file with root privileges. It is available in the package nautilus-admin.