Want to execute sudo command on shell startup

I've put a command sudo do something in my ~/.bashrc, this works but everytime I open the terminal I have to type in my password. How do I make it so there is no password-typing?


You can use the NOPASSWD attribute in the sudoers file to tell sudo not to require a password. A line like the follows in the sudoers file should let you run that command without a password:

yourlogin ALL=(ALL) NOPASSWD: command_here

To edit the sudoers file, run the command sudo visudo.