Edited sudoers file with text editor - now can't run sudo
I see you've tagged your question osx
so if you've done this on a mac, make use of the GUI.
- Open any Finder window and press
cmd shift G
- Type
/etc/sudoers
and pressreturn
to go to the file - Press
cmd i
with the file highlighted - Scroll to the bottom of that info window to 'Sharing & Permissions' and click the lock icon in the bottom right
- Type an admin username and password
- Now add yourself in that window with the
+
button and select 'Read and Write' privileges - Open the file in any editor and fix what you screwed up the first time!