Find yourself entering your password quite often when running a "sudo" command? This is because it only lasts for 15 minutes by default, and can be a bit of nuisance if you're entering commands that are spaced apart from time to time. You can actually adjust this to your liking by making a simple tweak.
- Enter "sudo visudo" in the terminal
- Scroll down and find the "Defaults env_reset" line
- Change it "Defaults env_reset, timestamp_timeout=30" if you want the session to last for 30 minutes
- Hold "Ctrl" and hit "X" then press "Y" to save
Bonus: You can do a "sudo -s" that can keep you logged into the session until you close the terminal window.