When You’re Tired of Typing “sudo”

Here’s a neat trick: when you’re in the terminal, type sudo su to become the super user! Now, you don’t have to type in sudo this or sudo that (or even gksudo) for every command. You will stay logged in as the super user as long as the terminal remains open!

UPDATE September 22, 2008: One user, “Joss,” has pointed out to me that you could just type su instead of sudo su. Unfortunately, it does not work for me on my end (Xubuntu 8.04.1 64-bit). As with any command, prepend with “man” to learn more about it (e.g., “man su”). (Tip: whenever you’re viewing a manual with “man,” press Q on your keyboard to exit.)

UPDATE June 16, 2010: I’ve been using “su -m” to become the super user (root) for over a year now. The “m” flag keeps my local variables — so all of my neat customizations and aliases from ~/.zshrc are accessible, even as root!

One thought on “When You’re Tired of Typing “sudo”

  1. the thing is simple, `su` asks you for the password of the target user and it doesn’t ask for password when you are the superuser already, `sudo` asks for _your_ password to make an action as the superuser. To be able to do `su` you need to know the root password (and actually have one set), `sudo su` doesn’t. Also consider `sudo su -` to get a clean superuser environment instead of one polluted with your environmental variables.

Comments are closed.